Skip to content

fix(codex): late-child cancellation waits on its serial reader #331

Closed

Description

@lukemaj

What: A late Codex child outside an explicit cut-in can block the native reader for ten seconds while waiting for its own interrupt reply.
Why: Its turn-start handler awaits a request whose acknowledgement the same serial reader must parse.
So what: Reproduce and repair the ordinary lifecycle path separately; #285 removes the request only for its governed urgent cohort.

Outcome and proof

CodexAdapterV2.emitSubagentProviderTurnStarted awaits turn/interrupt under turnTerminalizationPermit. The actual effect-codex-app-server protocol/client await each notification handler before reading the next input line. No native CLI failure is claimed. Reproduce using the actual stdio client: gate the interrupt answer, send a sentinel behind it and require that sentinel to be consumed without advancing a timeout. Register the child before bounded cancellation outside the reader; preserve native outcomes, ordinary Stop, goal continuations and exact identity.

This advances truthful Promachos/Drafter work in the Objective. This is source-level evidence on555f0a00198b7aba75d8e8ce13af9c7d983712f4, independently inspected after Opus R7 identified it, not a native runtime reproduction. Searches of open/closed Codex issues found no dedicated report; #299 concerns soft-restart subscriber handover, a related but different mechanism.

Non-goals and blockers

No expansion or waiver of #285, shared app-server kill, version, deployment or live data mutation. A faithful reproduction and current upstream search are required before selecting implementation. Use actual adapters/services and native I/O gates, Deferred/persisted milestones and no sleeps or polling.

Requirements and who asked: Global Work requires recording adjacent problems discovered by #285's design; the user requires truthful native work and useful Stop controls.
Deleted: No new cancellation architecture, public intent, liveness registry, polling barrier or unsupported OS-exit promise.
Bottleneck: The handler and its awaited reply share one serial reader.
Checked myself: Actual late-child branch, permit/timeout, protocol/client notification ordering, R7 D-1 and related issue searches; runtime proof remains pending.

Activity

  1. lukemaj commented on Oct 18, 2026

    @lukemaj
    ContributorAuthor

    Upstream search (before implementation): pingdotgg/t3code main at 28c32d20c3 carries the same awaited turn/interrupt in emitSubagentProviderTurnStarted. Searches of upstream Issues and PRs ("late subagent interrupt", "codex-late-subagent-interrupt", "serial reader interrupt codex", "subagent interrupt timeout", "turn/interrupt notification handler") found no report or fix.

    Handoff: reproduced and fixed in #495

    • Branch: fix/331-codex-late-child-cancel, head ff996cb3a6e4024302b5ba2d7f0ef7a5f9668800, base 406c3ef86d.
    • Reproduction: new test in the CodexAdapterV2 cut-in cohort harness (production adapter, real effect-codex-app-server stdio client). Before the fix the reader sentinel behind the unanswered late-child turn/interrupt timed out the test (15 s); a disposable TestClock probe showed it still blocked at 9 s and released at 10 s, the interrupt timeout. After the fix it passes with no clock advance.
    • Proof: vp test run apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts 190 passed; targeted vp lint no new findings; apps/server typecheck exit 0; scripts/fork-check.sh OK.
    • Not reviewed yet; fix(codex): Stop loses native work after a natural root end #332 untouched.

    Model and harness: Claude Opus 5.5 via Claude Code (T3 Code).

  2. added a commit that references this issue on Oct 18, 2026
    e869683
  3. added a commit that references this issue on Oct 29, 2026
    9a1d4ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions