Skip to content

Recover Codex slots after verified spawn rejection (T26) - #168

Merged
erickb336 merged 3 commits into
mainfrom
codex/t26-dispatch-failure
Oct 13, 2026
Merged

erickb336 merged 3 commits into
mainfrom
codex/t26-dispatch-failure

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #167
Sage task T26

A rejected initial Codex spawn no longer leaves its Sage slot occupied when the protected native transcript proves the supported unknown-model rejection. The same sender can then prepare and dispatch a new child. Other errors or any successful-child evidence retain capacity.

Core stores an exact, immutable failure receipt separately from completion. Changed evidence, bound assignments, and late binding refuse. Codex reconciles before a new admitted spawn and after native list/wait callbacks. This also recovers preserved work after Sage is off. Source changes are in packages/sage-core/ and packages/sage-codex/runtime/; generated plugins come from the build. Claude's active state-tool and hook files are unchanged.

Validation at 16a8efa900a785f498f6ab590bd52f648a5804b9:

  • npm run build: built 278 files.
  • npm run check: all checks pass. git diff --check: clean.
  • Focused recovery tests: 9 tests, 9 pass, 0 fail.
  • node --test scripts/codex-server.test.mjs: 104 tests, 104 pass, 0 fail.
  • The initial eight new tests fail on detached main 7720032. Core failures show the missing receipt API; adapter failures show the missing reconciliation.
  • node scripts/probe-codex-lifecycle.mjs --sage-failed-spawn: actual CLI 0.160.0, simulated model responses. At capacity one, one rejected spawn produces one failure receipt; a new child then binds and completes. Final counts: two reservations, one failure, one binding, one completion. Temporary profile removed.
  • The probe scripts alone on detached main fail with failed_dispatch_not_reconciled and remove their temporary profile.
  • node scripts/probe-codex-lifecycle.mjs --sage-receipt: existing report-receipt route passes and removes its temporary profile.
  • The additional terminal-ordering regression fails before the repair and on detached main. It verifies that completion or interruption before the call/result refuses, while valid earlier evidence remains readable.
  • Review repair: the parser now rejects post-terminal calls and results. Two clean code/security/QA cycles passed on the unchanged final commit.
  • Final npm test: 1,093 tests; 1,093 pass; 0 fail, cancelled, skipped, or todo. Exact-head CI run 38403246109 reports the same counts.

Every test/probe uses fake ps, pgrep, and kill first on PATH. Attack strings reach parsers only.

Not verified: other rejection kinds, later assignments, cross-session recovery, real-model behavior, a real-project pilot, or installed automatic enforcement. Automatic Sage remains incomplete; see #88.

@erickb336
erickb336 marked this pull request as ready for review October 13, 2026 13:22
@erickb336
erickb336 merged commit 428cc47 into main Oct 13, 2026
1 check passed
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.

Recover Codex capacity after a verified spawn rejection (T26)

1 participant