fix(codex): release raw assistant app-server completions [AI-assisted]#82403
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-reproducible: current main captures raw assistant text but the focused raw-only test still expects a timeout when turn/completed never arrives. The PR body also supplies after-fix live output from a real local Codex app-server run. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the guarded raw assistant completion fallback once required CI and merge gates are green, then close #82343 if the merged behavior resolves the delivery deadlock. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main captures raw assistant text but the focused raw-only test still expects a timeout when turn/completed never arrives. The PR body also supplies after-fix live output from a real local Codex app-server run. Is this the best way to solve the issue? Yes. Reusing the existing assistant-output idle release with tool-handoff and commentary guards is the narrow maintainable fix for the observed Codex app-server completion gap. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 863069e2c66a. |
82ccade to
ee3c5bb
Compare
|
Real-world hit confirmation. Diagnosing recurring agent-process hangs in production and the shape lines up exactly. Setup: OC Two reproducing PIDs captured this morning (4h and 24min old):
The codex children had exited cleanly, but OC's run-attempt was apparently still awaiting Looking forward to the merge — this is likely the dominant cause of the agent-process accumulation we've been tracking, and it complements #71710 (which focuses on the SIGTERM-doesn't-bridge angle). |
f043b5c to
9c96e93
Compare
|
[P1] Treat all post-request handoffs as raw-assistant release blockers
A focused regression for the |
3fe9dd6 to
38e06be
Compare
|
Landed via rebase onto current main.
Thanks @IWhatsskill! |
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
openclaw#82403) * fix(codex): release raw assistant app-server completions * refactor(codex): simplify raw assistant release guard * fix(codex): ignore commentary raw assistant completions * docs: add codex app-server completion changelog --------- Co-authored-by: JARVIS-Glasses <284122573+JARVIS-Glasses@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> Co-authored-by: Peter Steinberger <steipete@gmail.com>
Summary
rawResponseItem/completedwith final text but never sendturn/completed, leaving OpenClaw waiting for the terminal idle timeout.Change Type
Scope
Linked Issue/PR
Real behavior proof
turn/completedreleases the Codex app-server run, while post-tool raw assistant progress does not release the turn early.codexCLI logged in with ChatGPT, real Codex app-server usinggpt-5.5, and the realrunCodexAppServerAttemptpath. Workspace andCODEX_HOMEare redacted below.node --import tsx C:\tmp\openclaw-real-run-attempt-proof.mjsagentMessagenotifications to isolate the raw fallback, droppedturn/completedonly for the final-raw scenario, and delayedturn/completedby 1000ms after post-tool raw assistant progress.{ "ok": true, "model": "gpt-5.5", "workspace": "<redacted-temp-workspace>", "codexHome": "<redacted-codex-home>", "finalRawWithoutTurnCompleted": { "passed": true, "proof": { "sawRawAssistant": true, "droppedTurnCompleted": 1, "interruptRequests": 1 }, "result": { "aborted": false, "timedOut": false, "promptError": null, "assistantTexts": ["REAL_OPENCLAW_RAW_FINAL_PROOF"] } }, "postToolRawAssistantProgress": { "passed": true, "proof": { "sawToolRequest": true, "sawPostToolRawAssistant": true, "delayedAfterPostToolRawAssistantMs": 1000, "interruptRequests": 0 }, "result": { "aborted": false, "timedOut": false, "promptError": null, "assistantTexts": ["REAL_OPENCLAW_TOOL_DONE_PROOF"] } } }turn/completedwithout issuingturn/interrupt.Root Cause
event-projectoralready captured assistant text from raw assistantrawResponseItem/completednotifications, butrun-attemptonly released completion onturn/completed, abort markers, or completedagentMessageitems.agentMessagesilence, but left the raw assistant final-output path waiting for the terminal watchdog.Regression Test Plan
extensions/codex/src/app-server/run-attempt.test.tsrawResponseItem/completedwith final text and noturn/completedreleases the run with the captured assistant text; post-tool raw assistant progress does not release beforeturn/completed.extensions/codex/src/app-server/event-projector.test.tsalready proves raw assistant text extraction; this PR adds the missing run-attempt release coverage.User-visible / Behavior Changes
Codex app-server turns that have already produced pre-tool final raw assistant text can deliver instead of waiting for the terminal idle timeout when
turn/completednever arrives.Diagram
Security Impact
NoNoNoNoNoRepro + Verification
Environment
tsxgpt-5.5runCodexAppServerAttemptCODEX_HOMESteps
rawResponseItem/completedfor assistant output and dropturn/completedin the local redacting proxy.turn/completedfor 1000ms.Expected
turn/completed.Actual
turn/completeduntil the terminal idle timeout in the final-raw scenario.Evidence
Human Verification
turn/completedreleases with assistant textturn/completedrunCodexAppServerAttemptReview Conversations
Compatibility / Migration
YesNoNoRisks and Mitigations
turn/completed.