Skip to content

[Bug] GitHub CLI is missing from PawWork shell environment #170

@Astro-Han

Description

@Astro-Han

What happened?

After PR #167, PawWork can preserve the GitHub CLI auth config directionally, but gh is now reported as missing inside PawWork shell or agent shell flows. On the same machine, the normal outer shell resolves gh at /opt/homebrew/bin/gh and reports version 2.91.0, so this is not a missing local installation.

The likely regression is in packages/desktop-electron/src/main/server.ts: buildServerEnv now builds mergedEnv as { ...shellEnv, ...process.env }. In a macOS GUI app, process.env.PATH can be narrower than the login shell PATH and can overwrite the shell PATH that contains Homebrew paths such as /opt/homebrew/bin.

Steps to reproduce

  1. Launch PawWork from the desktop app after PR fix: preserve gh cli auth config #167.
  2. Open a PawWork project where gh is installed and available in the user's normal terminal.
  3. Run a shell or agent shell command that needs gh, for example gh --help or gh auth status.
  4. Observe PawWork reporting that gh cannot be found.

What did you expect to happen?

PawWork should preserve the login shell PATH for command discovery, so gh resolves the same way it does in the user's normal terminal. The #167 behavior should still preserve GitHub CLI authentication by deriving and injecting GH_CONFIG_DIR before PawWork overrides XDG_CONFIG_HOME for its own runtime namespace.

PawWork version

v0.2.5 dev build after PR #167

OS version

macOS, observed on Apple Silicon with Homebrew gh installed under /opt/homebrew/bin

Can you reproduce it again?

Yes, every time

Screenshots, recordings, or extra context

Local evidence: outer shell resolves /opt/homebrew/bin/gh and gh version 2.91.0. PR #167 changed buildServerEnv to compute mergedEnv = { ...shellEnv, ...process.env }, which lets the GUI process PATH override the login shell PATH. A narrow fix should keep the shell PATH merge behavior while computing GH_CONFIG_DIR with explicit priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High prioritybugSomething isn't workingplatformElectron shell, OS integration, packaging, updater, signing, paths, and permissions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions