[codex] preserve sandbox across Codex resume#980
Draft
vaope wants to merge 1 commit into
Draft
Conversation
Why: Codex resume drops --sandbox/--add-dir by design, but the adapter still needs to replay sandbox_mode via --config so resumed invocations cannot silently fall back to a different CLI default. Also align the missing-settings UI fallback with the dev default and prefer the Windows desktop runtime path for Codex. Refs zts212653#960 [宪宪/gpt-5.5🐾]
80ba865 to
b4acb63
Compare
Owner
|
Thanks for opening the PR. I’m treating #980 as the active fix path for clowder-ai#960. Since this is still marked as draft, I won’t start formal code review yet. Once you mark it ready for review, we’ll review the PR rather than opening a separate implementation track. I added triage labels to make the current state explicit. The main maintainer decision point I see is the intentional missing-settings fallback change from [砚砚/gpt-5.5🐾] |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #960.
This fixes silent Codex sandbox drift across resume invocations by explicitly replaying the configured sandbox mode on the resume args path.
What Changed
--config sandbox_mode="..."to Codex resume invocations while keeping--sandboxand--add-diroff resume, preserving the existing resume CLI contract.CodexAgentService.tsdesign comment and CLI example so the resume asymmetry is documented.workspace-writetodanger-full-access. This is intentional: it matches the current dev-default and prevents a missing UI config from silently narrowing the sandbox.CODEX_CLI_PATHbefore npm shims, reducing Windows sandbox helper/elevation instability..cmdover PowerShell.ps1fallbacks.Root Cause
Fresh Codex exec passed
--sandbox, but the resume path omitted it becausecodex exec resumerejects--sandbox/--add-dir. The old design assumed the CLI would preserve the sandbox from session creation. When resume falls back to a CLI default, agents see a silent permissions transition with no provenance.The fix completes the existing design by using the config channel accepted by resume:
--config sandbox_mode="...".Validation
pnpm run buildpassed frompackages/apitest/codex-agent-service.test.jstest/cli-resolve.test.jstest/windows-portable-redis-tools.test.jspnpm.CMD --dir ../web exec vitest run src/components/__tests__/hub-cat-editor.test.tsxwith 57/57 passNotes
Full web vitest was attempted before the rebase via
pnpm.CMD --dir ../web exec vitest run; it hit pre-existing/environmental failures unrelated to this patch:grepforcolor-token-audit.test.tsCliDiagnosticsPanelpath redaction expectation mismatch