Skip to content

Emit unified exec end on startup failure#22743

Open
starr-openai wants to merge 2 commits into
mainfrom
starr/fullci-2-unified-exec-startup
Open

Emit unified exec end on startup failure#22743
starr-openai wants to merge 2 commits into
mainfrom
starr/fullci-2-unified-exec-startup

Conversation

@starr-openai
Copy link
Copy Markdown
Contributor

@starr-openai starr-openai commented May 15, 2026

Why

Remote rust-ci-full exposed unified exec startup failures that happen before a process record exists. In that path, clients could receive the startup error without the matching exec end lifecycle event, leaving the tool call half-open from the app-server/client perspective. Approval rejections in the same startup path also need to stay declined rather than being reported as generic execution failures.

Failure evidence: remote Ubuntu test job with uploaded nextest JUnit artifact

What changed

  • emit the matching unified exec end event when startup fails before the process is stored
  • preserve captured sandbox-denial output in that startup-failure event path
  • preserve startup approval rejections as declined exec endings
  • keep the successful-startup begin event at its original point after process creation so long-running session interrupt behavior does not regress
  • add focused regression coverage for failed, sandbox-denied, and rejected startup endings

Validation

  • cargo test -p codex-core startup_ -- --nocapture
  • cargo test -p codex-core --test all unified_exec_interrupt_preserves_long_running_session -- --nocapture

@starr-openai starr-openai force-pushed the starr/fullci-1-remote-diff branch from 85c0cc1 to 5f091bb Compare May 15, 2026 01:46
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch from a422183 to db00244 Compare May 15, 2026 01:46
@starr-openai starr-openai force-pushed the starr/fullci-1-remote-diff branch from 5f091bb to bbe638a Compare May 15, 2026 01:46
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch 3 times, most recently from 21c7e73 to ca1d3de Compare May 15, 2026 02:19
@starr-openai starr-openai force-pushed the starr/fullci-1-remote-diff branch from bbe638a to 3d80311 Compare May 15, 2026 02:41
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch 6 times, most recently from 77a8012 to c2a9217 Compare May 15, 2026 12:18
@starr-openai starr-openai force-pushed the starr/fullci-1-remote-diff branch from 6078c03 to cabeb8c Compare May 15, 2026 12:18
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch 3 times, most recently from 8c0690f to 8d80010 Compare May 15, 2026 19:41
@starr-openai starr-openai force-pushed the starr/fullci-1-remote-diff branch from cabeb8c to 84af755 Compare May 15, 2026 20:31
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch from 8d80010 to 5b422b9 Compare May 15, 2026 20:31
@starr-openai starr-openai marked this pull request as ready for review May 19, 2026 08:54
@starr-openai starr-openai requested a review from a team as a code owner May 19, 2026 08:54
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b422b9e11

ℹ️ 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".

Comment thread codex-rs/core/src/unified_exec/process_manager.rs
Comment on lines +1091 to +1094
ToolError::Rejected(message) if message == "rejected by user" => {
UnifiedExecError::rejected(message)
}
ToolError::Rejected(message) => UnifiedExecError::create_process(message),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Classify guardian denials as declined

In sessions where approval is routed through Guardian or strict auto-review, reject_if_not_approved returns ToolError::Rejected with a guardian-specific denial or timeout message rather than exactly "rejected by user", so this branch falls through to CreateProcess and the startup failure event is emitted as Failed. That means a unified exec that was declined before any process was started appears to app-server clients as a command failure instead of a declined command, unlike the shell ToolEmitter::finish path that treats ToolError::Rejected as Declined; preserve rejection semantics for these approval-denial messages instead of only the literal local-user string.

Useful? React with 👍 / 👎.

@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch 3 times, most recently from 374d141 to 55bdd2c Compare May 20, 2026 00:33
@starr-openai starr-openai changed the base branch from starr/fullci-1-remote-diff to main May 20, 2026 00:33
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch 2 times, most recently from 912fd90 to 85d0d78 Compare May 20, 2026 01:23
@starr-openai starr-openai force-pushed the starr/fullci-2-unified-exec-startup branch from 5967bef to 9d4cfa0 Compare May 20, 2026 02:45
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.

1 participant