fix(core): emit unified exec sandbox denial lifecycle#22395
Open
mldangelo-oai wants to merge 2 commits into
Open
fix(core): emit unified exec sandbox denial lifecycle#22395mldangelo-oai wants to merge 2 commits into
mldangelo-oai wants to merge 2 commits into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
…ed-exec-sandbox-denial-lifecycle
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.
What
Why
In the publicly released Codex app server surface, a unified-exec sandbox denial can become model-visible while the raw app-server stream omits the corresponding
commandExecutionlifecycle entirely. That leaves clients without the expected start/end execution signals for a failed command.Reproduction
Observed against public
codex-cli 0.130.0:codex app-serverwith unified exec enabled.item/started/ faileditem/completedcommand lifecycle.Control case:
codex app-server --disable unified_execemits the expected command lifecycle notifications.Root cause
UnifiedExecProcessManager::exec_command(...)returns early onUnifiedExecError::SandboxDeniedbefore emitting begin/end lifecycle notifications.Fix
Emit a failed unified-exec lifecycle for that pre-spawn denial branch, preserving the denial result while keeping the app-server event stream consistent with other failed command paths.
Duplicate audit
Before opening this PR, I searched public issues and PRs for
commandExecution,item/commandExecution/outputDelta,unified_exec,SandboxDenied,sandbox_apply,ExecCommandBegin, andExecCommandEnd. I found adjacent context, but no exact public duplicate report or fix for this missing lifecycle path.Validation
cargo test -p codex-core failed_pre_spawn_sandbox_denial_emits_begin_and_end --libcargo test -p codex-core failed_initial_end_for_unstored_process_uses_fallback_output --libcargo fmt --checkgit diff --checkjust fmtjust fix -p codex-corePublic bug-report evidence and repro notes were prepared before this PR so the behavior can be evaluated independently of the patch.