Repository navigation
fix(codex): honor configured tool PATH in native commands - #157290
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 24, 2026, 1:21 PM ET / 17:21 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch extends the configured exec PATH prefix to locally owned Codex commands in new and resumed threads, while preserving native PATH and login settings. Merge readiness⛔ Blocked before merge - 2 items remain The previous case-insensitive filter finding is addressed, and current main still lacks this native Codex PATH behavior. Linux native execution is well supported by the supplied proof; the Windows-specific path remains unverified. Priority: P2 Review scores
Verification
How this fits togetherThe agent harness resolves exec configuration and passes a local tool environment to the Codex plugin. The plugin applies that environment when starting Codex and its native command threads. flowchart LR
A[Exec configuration] --> B[Agent harness]
B --> C{Codex placement}
C -->|Owned local process| D[Native shell policy]
C -->|Remote or sandbox| E[Placement environment]
D --> F[Codex commands]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +169, Tests +725, Docs +1. Total +895 across 25 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one exec-policy source for the prefix and one Codex shell-policy owner for native precedence, then confirm Path/PATH aliases through a Windows native fresh and resume run. Do we have a high-confidence way to reproduce the issue? Yes. Current main lacks the native prefix bridge, and the PR supplies a pinned Codex fresh/resume scenario with a reported before-fix failure and after-fix command lookup. Is this the best way to solve the issue? Yes for the demonstrated local Linux path. Reusing the exec-policy resolver and Codex's native shell-policy owner is a coherent approach; Windows-native alias behavior still needs platform proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6e8d06876fd1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review Please review head 986c4f8. The resolver now distinguishes the configured prefix from the automatic CLI shim, preserving native login-shell defaults for absent, empty, and whitespace-only effective prefixes. The PATH option table is aligned. A pinned real-binary fresh/cold-resume command regression is included; isolated Testbox proof is running and the PR body marks its result pending. Independent scoped review found no P0/P1 issues. |
|
🦞👀 Re-review progress:
|
986c4f8 to
74ed5ff
Compare
|
@clawsweeper re-review Review current head 266 focused tests passed, including real Codex 0.155.1 fresh and cold-resumed commands with and without a prefix. SDK surface and full build passed. The PR body records the exact source/tree and terminal Testbox command result ( |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head: Resolved revision 4's P1 at the shell-policy owner: exact managed filter aliases are coalesced case-insensitively before emitting one include per name. Unrelated/wildcard filters, legacy include-only handling, native set values, and existing login policy remain unchanged. Direct pinned Codex inspection confirms duplicate casefold patterns are rejected before layer merge, under the filter validation contract. Exact-source Testbox proof: 269/269 tests across all six affected files, including five real pinned-Codex fresh/cold-resume scenarios. The new native restrictive-filter case checks both selected prefix commands and retained native PATH. A bounded pre-fix control failed both alias-regression cases, then restored clean source before the positive suite. Independent patch review and scoped P0/P1 autoreview are clean. Command exit 0 / succeeded; owned lease stopped. The PR body now reports actual per-file wall times for all six files, wrapper time, command time, and explicitly labeled aggregate hosted CI runner-seconds. No extra configuration or module/build boundary change. Production delta for this correction: +7 lines, required by the dependency's case-insensitive pattern identity. Fresh integration CI will include the independently landed prerequisite #157394. |
|
🦞👀 Re-review progress:
|
|
Maintainer disposition for exact head I accept the remaining Windows-native qualification gap for this Linux native-execution repair, as offered in revision 5's maintainer options. The current review reports no actionable code findings; all required checks are green. The 269-test exact-source Linux proof includes real pinned-Codex fresh and cold-resumed command selection. Existing unit coverage checks alias normalization, and the platform-aware PATH/Path casing assertions remain in the suite. This is not a claim of live Windows-native verification. The optional rank-up move is deferred as follow-up: Windows native Codex fresh/cold-resume PATH/Path qualification. That platform run is outside the reported Linux incident and adds no prerequisite configuration or migration to this fix. The documented shell-startup limitations remain explicit. No source changed after the reviewed SHA, so another rating-only re-review is unnecessary. |
* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits) fix(ci): prevent Security Review checkout retry collisions (#157652) fix(ci): recover interrupted Security Review response bodies (#157651) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) ...
* commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) docs(gateway): show how we build OpenClaw on Team (#157675) refactor: verify IRC surrogate chunking over loopback (#157580) ...
* fix(ui): keep Stop available while drafts cannot send * chore: integrate main fixes for Stop UI validation * commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits) fix(ci): prevent Security Review checkout retry collisions (#157652) fix(ci): recover interrupted Security Review response bodies (#157651) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) ... Co-authored-by: Vincent Koc <[email protected]>
…57290) * fix(codex): preserve configured tool PATH in native execution * fix(codex): preserve native shell defaults without a configured PATH * fix(codex): preserve native PATH beneath configured prefixes * fix(codex): preserve native login policy with tool prefixes * fix(codex): canonicalize managed shell filter aliases
* fix(ui): keep Stop available while drafts cannot send * chore: integrate main fixes for Stop UI validation * commit '5dae23c843013fce2e0bb80037d232bbabfc70e5': (41 commits) fix(ci): prevent Security Review checkout retry collisions (openclaw#157652) fix(ci): recover interrupted Security Review response bodies (openclaw#157651) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (openclaw#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131) refactor(msteams): share stored service URL validation (openclaw#157706) fix(codex): honor configured tool PATH in native commands (openclaw#157290) refactor(msteams): share approval kind labels (openclaw#157705) fix(sessions): keep session results current during cold reads (openclaw#156121) fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535) refactor(i18n): reuse native branch candidate extraction (openclaw#157636) fix(update): preserve recovery files after ownership refusal (openclaw#148890) fix(test): prevent late announcements from contaminating registry tests (openclaw#157681) fix(e2e): scan full onboarding logs for prompts (openclaw#157624) refactor(session-tools): derive contracts from schemas (openclaw#156365) refactor(channels): derive config contracts from schemas (openclaw#156367) perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689) refactor: reuse prepared fixtures in slow core tests (openclaw#157685) refactor(codex): reuse marketplace reference selection (openclaw#157621) chore(ui): refresh control ui locales (openclaw#157710) ... Co-authored-by: Vincent Koc <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ... * Merge frozen main to include the question fixture authority fix * commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) docs(gateway): show how we build OpenClaw on Team (#157675) refactor: verify IRC surrogate chunking over loopback (#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... * Merge frozen main to include the question fixture authority fix * commit 'dc64cc3a3a3cf38fff1e44c1d7af42a32929d7e4': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (openclaw#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131) refactor(msteams): share stored service URL validation (openclaw#157706) fix(codex): honor configured tool PATH in native commands (openclaw#157290) refactor(msteams): share approval kind labels (openclaw#157705) fix(sessions): keep session results current during cold reads (openclaw#156121) fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535) refactor(i18n): reuse native branch candidate extraction (openclaw#157636) fix(update): preserve recovery files after ownership refusal (openclaw#148890) fix(test): prevent late announcements from contaminating registry tests (openclaw#157681) fix(e2e): scan full onboarding logs for prompts (openclaw#157624) refactor(session-tools): derive contracts from schemas (openclaw#156365) refactor(channels): derive config contracts from schemas (openclaw#156367) perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689) refactor: reuse prepared fixtures in slow core tests (openclaw#157685) refactor(codex): reuse marketplace reference selection (openclaw#157621) chore(ui): refresh control ui locales (openclaw#157710) docs(gateway): show how we build OpenClaw on Team (openclaw#157675) refactor: verify IRC surrogate chunking over loopback (openclaw#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Native Codex commands could select an older system binary even when
tools.exec.pathPrependselected the preferred directory for ordinary exec commands.User Impact
Owned local Codex commands receive the effective global or per-agent prefix in new and resumed threads, ahead of the operator's native or request-level PATH. Existing native login policy remains unchanged, including explicit
login: truerequests and an operator-configuredallow_login_shell = false. No new configuration or migration is required.Sandbox, remote-workspace, and socket-backed execution retain their own environment. Codex reapplies explicit environment values after loading a shell snapshot; startup files can still change PATH when snapshots are unavailable or bypassed, or when the command shell starts. Disabling login skips login profiles, not every startup file.
Why This Change Was Made
The agent harness captures tool PATH and prefix intent through the existing execution-policy resolver. The Codex plugin applies it at its owned local process and thread boundaries. Native policy is retained beneath request overrides, including an explicit empty PATH; Windows PATH aliases receive the same result. This replaces the earlier full-PATH overwrite.
The corrections preserve native login policy and canonicalize managed filter aliases case-insensitively. Codex validates each policy layer before merging it, so emitting both
pathandPATHrejects an otherwise valid thread. Existing remote, identity, and credential restrictions, unrelated filter patterns, and legacy policy handling remain intact.Production: +188/-19, net +169 lines for the environment ownership boundary and native config contract. Tests/routing: +954/-229, net +725, including moved coverage. Docs: net +1. No additional launcher, public SDK export, config key, or stored-data change.
Evidence
ab6e33560ef92b7397fa54a5301eafb3f694cc91, tree9e2a2f1b0cb8ad2a971f2fc4220af2218b968a47. Independent contract review and scoped P0/P1 autoreview found no actionable finding.path = "exclude". Prefix cases verify both selected commands and preserved native PATH commands; the configured directory changes between processes.66610d5: both start/resume alias-regression cases failed as expected (2 failed, 13 skipped). It restored the candidate and verified clean source before the 269 passing tests. The earlier login-control case independently failed against the74ed5ffconnection producer. Controls are separate from the positive test count.74ed5ff3c7deced35035b835576374a35b8e4813): 266 tests across six files, SDK surface validation, and the full build passed in Testbox. The later corrections change only the login predicate, shell-policy normalization, their tests, and docs; it does not change module or packaging boundaries.exitCode=0,runStatus=succeeded.{"sourceSha":"ab6e33560ef92b7397fa54a5301eafb3f694cc91","provider":"blacksmith-testbox","exitCode":0,"runStatus":"succeeded","focusedTestsPassed":269,"nativeScenariosPassed":5}Measured test cost and dependency contracts
src/infra/path-prepend.test.tssrc/agents/harness/host-capability.environment.test.tsextensions/codex/src/app-server/thread-shell-environment.test.tsextensions/codex/src/app-server/thread-lifecycle.test.tsextensions/codex/src/app-server/run-attempt-connection.environment.test.tsextensions/codex/src/app-server/thread-shell-environment.native.test.tsAll rows are measured at
ab6e335, using Vitest JSON start/end timestamps for file wall time and monotonic timing for each repository wrapper. Sequential focused wrappers total 139.820 s. The pre-fix two-case control took 45.193 s. The enclosing Testbox command took 319.173 s including source/dependency preparation; frozen install took 9.8 s. Earlier full build at74ed5fftook 1426.9 s and was not repeated for these policy-only corrections.Hosted CI cost snapshot: the previous
66610d5run had 132 completed jobs totaling 37,057 runner-seconds, computed from job start/completion timestamps. This is aggregate overlapping runner time, not PR-attributable cost or wall duration. Its stale integration checkout preceded the independently landed baseline fix in #157394; this source push refreshes integration CI. Current required CI remains the landing gate.Direct inspection of pinned Codex be2951e covered native login acceptance, snapshot environment replay, snapshot availability, nullable shell-policy fields, per-layer filter validation, validation before merge, and JSON-to-TOML null conversion.
All current review requests are addressed: native PATH precedence, fresh/resumed native execution, preserved login behavior with and without existing exec prefixes, canonical case-insensitive native filters, and measured per-file/hosted test cost. Authenticated provider testing and production deployment remain separate work; this PR does not claim live host recovery. Earlier build advisory warnings for startup CSS and isolated Mermaid size remain UI-budget follow-ups.