Skip to content

fix(codex): propagate extended PATH to codex subprocess#6874

Merged
katzdave merged 1 commit intoblock:mainfrom
RamXX:fix/codex-provider-path-propagation
Feb 6, 2026
Merged

fix(codex): propagate extended PATH to codex subprocess#6874
katzdave merged 1 commit intoblock:mainfrom
RamXX:fix/codex-provider-path-propagation

Conversation

@RamXX
Copy link
Contributor

@RamXX RamXX commented Feb 1, 2026

Summary

When the Codex CLI provider spawns codex exec, the subprocess inherits the parent process's PATH. When goose is launched from the desktop app (Electron), this PATH is significantly more limited than a terminal session -- it lacks paths added by nvm, volta, pnpm, fnm, and other Node version managers. This causes the codex subprocess to fail finding Node.js and other dependencies.

This fix adds PATH propagation using SearchPaths::builder().with_npm().path(), matching the existing pattern already used by gemini_cli.rs. The subprocess now gets access to common binary locations (~/.local/bin, /opt/homebrew/bin, ~/.npm-global/bin, etc.) plus the system PATH.

Type of Change

  • Bug fix

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

  • All 30 existing codex provider unit tests pass
  • cargo fmt, cargo clippy -D warnings clean
  • Manual testing: verified codex exec works with the extended PATH
  • The fix is a 4-line addition following an established pattern (gemini_cli.rs)

Related Issues

Relates to #6263
Reported by @Aerasyn: #6263 (comment)
Also noted by @michaelneale during original review: "I had some issues with my codex install and the desktop - might have to have a follow on, but ran out of time for it. Something to do with path maybe."

@RamXX RamXX mentioned this pull request Feb 1, 2026
8 tasks
When the Codex provider spawns `codex exec`, the subprocess inherits
the parent process PATH, which is limited when launched from the
desktop app. This causes failures finding Node.js and other
dependencies needed by the codex CLI.

Add PATH propagation using SearchPaths (matching the existing pattern
in gemini_cli.rs) so the subprocess gets access to common binary
locations like ~/.local/bin, /opt/homebrew/bin, and ~/.npm-global/bin.

Fixes issue reported in block#6263 (comment by @Aerasyn).

Signed-off-by: RamXX <ramxx@ramirosalas.com>
@RamXX RamXX force-pushed the fix/codex-provider-path-propagation branch from f0d4871 to bd4f7b0 Compare February 1, 2026 01:27
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

I think this makes sense. FYI @RamXX there is now a proper codex provider that uses the subscription, so could consider not using the cli now - one less thing (and is more full featured as it uses it as an api)

@RamXX
Copy link
Contributor Author

RamXX commented Feb 2, 2026

Thanks @michaelneale . Goose is moving so fast I can't keep up! thanks for the tip. I'll check it out.

@katzdave katzdave added this pull request to the merge queue Feb 6, 2026
Merged via the queue into block:main with commit 3324711 Feb 6, 2026
18 checks passed
zanesq added a commit that referenced this pull request Feb 6, 2026
* origin/main:
  Remove build-dependencies section from Cargo.toml (#6946)
  add /rp-why skill blog post (#6997)
  fix: fix snake_case function names in code_execution instructions (#7035)
  Document max_turns settings for recipes and subagents (#7044)
  feat: update Groq declarative data with Preview Models (#7023)
  fix(codex): propagate extended PATH to codex subprocess (#6874)
  Switch tetrate tool filtering back to supports_computer_use (#7024)
  feat(ui): add inline rename for chat sessions in sidebar (#6995)
  fix: handle toolnames without underscores (#7015)
  feat(claude-code): use stream-json protocol for persistent sessions (#7029)
  test(providers): add model listing to live provider suite (#7038)
  Agent added too much (#7036)
  fix(deps): bump tree-sitter to 0.26 and set sqlx default-features=false to fix RUSTSEC advisories (#7031)
  feat: add image support and improve error resilience for Codex (#7033)
  fix(providers): Azure OpenAI model listing 404 during configure (#7034)
  fix(deps): bump bat to 0.26.1 to resolve RUSTSEC-2026-0008 (#7021)
  Don't swallow Tetrate errors  (#6998)
  docs: remove hardcoded_stuff links (#7016)

# Conflicts:
#	ui/desktop/src/components/GooseSidebar/AppSidebar.tsx
kuccello pushed a commit to kuccello/goose that referenced this pull request Feb 7, 2026
Signed-off-by: RamXX <ramxx@ramirosalas.com>
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.

3 participants