Skip to content

fix(sandbox): fix bwrap lookup for multi-entry PATH#15973

Merged
viyatb-oai merged 3 commits intomainfrom
codex/viyatb/fix-bwrap-path-split
Mar 27, 2026
Merged

fix(sandbox): fix bwrap lookup for multi-entry PATH#15973
viyatb-oai merged 3 commits intomainfrom
codex/viyatb/fix-bwrap-path-split

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

Summary

  • split the joined PATH before running system bwrap lookup
  • keep the existing workspace-local bwrap skip behavior intact
  • add regression tests that exercise real multi-entry search paths

Why

The PATH-based lookup added in #15791 still wrapped the raw PATH environment value as a single PathBuf before passing it through join_paths(). On Unix, a normal multi-entry PATH contains :, so that wrapper path is invalid as one path element and the lookup returns None.

That made Codex behave as if no system bwrap was installed even when bwrap was available on PATH, which is what users in #15340 were still hitting on 0.117.0-alpha.25.

Impact

System bwrap discovery now works with normal multi-entry PATH values instead of silently falling back to the vendored binary.

Fixes #15340.

Validation

  • just fmt
  • cargo test -p codex-sandboxing
  • cargo test -p codex-linux-sandbox
  • just fix -p codex-sandboxing
  • just argument-comment-lint

@viyatb-oai viyatb-oai changed the title [codex] fix bwrap lookup for multi-entry PATH fix(sandbox): fix bwrap lookup for multi-entry PATH Mar 27, 2026
@viyatb-oai viyatb-oai marked this pull request as ready for review March 27, 2026 08:18
@etraut-openai
Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@viyatb-oai viyatb-oai merged commit ec089fd into main Mar 27, 2026
60 of 62 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/fix-bwrap-path-split branch March 27, 2026 15:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex is looking for bwrap in wrong place

2 participants