Skip to content

fix: shell ACP providers on desktop - #10907

Merged
alexhancock merged 2 commits into
mainfrom
alexhancock/acp-shell-providers-desktop
Aug 5, 2026
Merged

fix: shell ACP providers on desktop#10907
alexhancock merged 2 commits into
mainfrom
alexhancock/acp-shell-providers-desktop

Conversation

@alexhancock

Copy link
Copy Markdown
Collaborator

Summary

When goose runs as a desktop app, Electron on macOS launches goosed with a minimal PATH inherited from launchd, so CLI-backed providers like claude-code can't find their binary (SearchPaths fails to resolve claude), the provider never gets built, and the agent reports "Provider not set."

Testing

Manual usage

Related Issues

Found this bug when working to resolve #10807

Screenshots/Demos (for UX changes)

Before:
Screenshot 2026-08-03 at 1 24 00 PM

After:
Screenshot 2026-08-03 at 1 24 16 PM

@alexhancock
alexhancock requested a review from jamadeo August 3, 2026 17:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcf0e601fe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/config/search_path.rs Outdated
@jbg

jbg commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

The auto codex review comment seems correct, this won't propagate PATH down which will matter for e.g. env node in a shebang, or subprocesses that use PATH somehow; they'll still use the minimal path and likely fail.

Beyond that, SearchPaths is used by a lot of things... if I'm reading this fix correctly, the search path used across the whole process now depends on whether that ACP provider initialisation path ran or not (if it ran, then the login shell paths are used everywhere; if it didn't, then the minimal paths are used everywhere). that seems potentially surprising and could cause problems; see #9313 where the argument was made that login-shell behaviour should be opt-in (most users would expect goose to use $PATH rather than snooping on the login shell's PATH)

Comment thread crates/goose/src/config/search_path.rs Outdated
@jbg

jbg commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

I think we might be better to find the login shell PATH (ensuring that we use the user's actual login shell) once (in TS) at startup of the desktop app and set the PATH environment variable that we run goose serve with to that; this would ensure we never do it for non-desktop invocations (goose cli) where the user's expectation is that the PATH from the environment is used directly.

@alexhancock
alexhancock force-pushed the alexhancock/acp-shell-providers-desktop branch from bcf0e60 to bd57713 Compare August 3, 2026 18:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd5771309a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/desktop/src/loginShellPath.ts Outdated
@alexhancock
alexhancock force-pushed the alexhancock/acp-shell-providers-desktop branch from bd57713 to 62e5b58 Compare August 4, 2026 14:07

@jbg jbg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments, looks good to me once they are resolved (or declared invalid!)

also acpConnection.ts is still sending goose/useLoginShellPath: true which I think is probably no longer needed? (duplicates the effect of this)

Comment thread ui/desktop/src/loginShellPath.ts Outdated
return Promise.resolve(null);
}

const shell = process.env.GOOSE_SHELL || process.env.SHELL || 'bash';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this shouldn't use GOOSE_SHELL, which is an override for the Developer extension.

Comment thread ui/desktop/src/loginShellPath.ts Outdated
* launchd, so goosed can't find CLI-backed providers (claude, etc.). Sourcing
* the user's profile via a login+interactive shell recovers the real PATH.
* Doing this here rather than in goosed keeps the plain `goose` CLI on the
* ambient PATH. Returns null on Windows, timeout, or any failure.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe this should return null on Linux too? I don't actually know whether any Linux desktop environment scrubs the environment of apps like macOS does, but I would think they probably run with a login shell's environment? I don't have easy access to a suitable machine to test this, but the conservative approach would probably be to make this macOS-only for now.

...process.env,
HOME: homeDir,
[pathKey]: `${path.dirname(binaryPath)}${path.delimiter}${currentPath}`,
[pathKey]: [path.dirname(binaryPath), currentPath, loginShellPath]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above says that loginShellPath gets prepended, but this seems to be appending

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ef1cdc034

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

});

const timer = setTimeout(() => {
child.kill();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Terminate the whole login-shell process group

When a macOS user's interactive login shell or startup script hangs long enough to hit this timeout, child.kill() sends the default SIGTERM only to the shell process. Interactive bash shells ignore SIGTERM by default (Bash manual), and any commands started from rc files are in the detached child's process group, so the resolver can return null while the stuck shell/process tree keeps running and holding its pipe; repeated desktop starts can leave orphaned shell readers around. Kill the detached process group, or use a non-ignorable fallback, before resolving the timeout.

Useful? React with 👍 / 👎.

@alexhancock
alexhancock merged commit f1e8e8c into main Aug 5, 2026
24 checks passed
@alexhancock
alexhancock deleted the alexhancock/acp-shell-providers-desktop branch August 5, 2026 13:37
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (32 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (101 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP harness tool calls poison session history: tool_use.name >200 chars causes permanent 400 after switching to Anthropic-format providers

2 participants