fix(codex-supervisor): handle stdout/stderr stream errors in stdio transport#101599
fix(codex-supervisor): handle stdout/stderr stream errors in stdio transport#101599Alix-007 wants to merge 5 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:45 AM ET / 06:45 UTC. Summary PR surface: Source +14, Tests +240. Total +254 across 2 files. Reproducibility: yes. Current main clearly attaches stdout/stderr data listeners without owning stdout/stderr readable-stream errors in the Codex Supervisor stdio transport, and the PR adds focused tests that exercise those failure paths. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused stdio transport hardening after ordinary maintainer review and exact-head merge checks, preserving stdout as the JSON-RPC failure channel and stderr as diagnostics. Do we have a high-confidence way to reproduce the issue? Yes. Current main clearly attaches stdout/stderr data listeners without owning stdout/stderr readable-stream errors in the Codex Supervisor stdio transport, and the PR adds focused tests that exercise those failure paths. Is this the best way to solve the issue? Yes. The fix is at the narrow stdio transport boundary and matches both upstream Codex stdout/stderr semantics and the merged sibling OpenClaw Codex app-server client behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20f355f2368c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +14, Tests +240. Total +254 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
|
@Alix-007 Hi! Following the same stream-error campaign pattern, I just opened two parallel PRs:
The fix shape mirrors your matrix deps #101597 (kill child on stream error + idempotent settle) and your realtime.ts pattern in #101596. No collision: I verified there's no open PR for either of those two files. Let me know if you'd like to coordinate or if you're already planning to cover those surfaces. |
|
Closing this as superseded by current Conflict proof:
Restoring |
Summary
errorhandler for the Codex Supervisor stdio JSON-RPC transport and route stdout stream failures through the existing connection failure and child shutdown patherrorhandler as diagnostic-only stderr-tail capture, preventing an unhandled readable-stream error without tearing down an otherwise healthy JSON-RPC sessionclose()idempotent with aclosingguard so stream failures and cleanup cannot send duplicate shutdown signals to the childnodechild stdio paths in focused regression testsextensions/codex-supervisor/src/json-rpc-client.tshas open PR fix(codex-supervisor): disable app-server websocket compression #88550, but that diff is isolated to WebSocket compression; no open PR was found for the stdio stdout/stderr readable-stream error issueVerification
TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-vitest.mjs extensions/codex-supervisor/src/json-rpc-client.test.ts- passed;Test Files 1 passed (1),Tests 4 passed (4).TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/codex-supervisor/src/json-rpc-client.ts extensions/codex-supervisor/src/json-rpc-client.test.ts- passed; exit 0.TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/codex-supervisor-stream-errors-repair.tsbuildinfo- passed; exit 0.git diff --check- passed; exit 0.Real behavior proof
Behavior addressed: Codex Supervisor stdio stdout readable-stream failures now fail the JSON-RPC connection and shut down the stdio child, while stderr readable-stream failures are handled as diagnostics instead of becoming unhandled errors.
Real environment tested: local Linux Node source checkout; the regression tests drive the real exported
connectCodexAppServerEndpointstdio transport with mocked streams and with a real spawnednodechild using pipe-backed stdout/stderr.Exact steps or command run after this patch:
TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-vitest.mjs extensions/codex-supervisor/src/json-rpc-client.test.tsEvidence after fix: one real-child regression destroys the parent-side stdout Readable and asserts the connection rejects with the stream error, sends exactly one SIGTERM, and observes child close
{ code: 143, signal: null }. A separate real-child regression destroys the parent-side stderr Readable and asserts the connection still initializes and no kill is sent until explicit close.Observed result after fix:
Test Files 1 passed (1)andTests 4 passed (4).What was not tested: a live Codex app-server binary; the proof uses a deterministic real Node stdio child through the same OpenClaw stdio transport. No OS-generated parent Readable error is claimed, because stdio pipe close/kill normally surfaces as EOF/
closerather than a parent read-sideerror.