Repository navigation
Recover verified native capacity rejections (T65) - #241
Merged
Merged
Conversation
…jection # Conflicts: # scripts/codex-server.test.mjs # scripts/probe-codex-lifecycle.mjs
erickb336
marked this pull request as ready for review
October 15, 2026 18:05
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #240
Sage task T65
When native Codex refuses a spawn at its agent limit, Sage can now release that rejected reservation and admit a fresh retry. Existing children and their completion history stay intact.
The protected transcript reader accepts the exact Codex 0.160.0 preflight result
collab spawn failed: agent thread limit reached, including requests that inherit their model. Session, owner, issuer, turn, call, argument hash, server authorship, and no-child checks remain unchanged. Unknown-model recovery keeps its existing behavior. Other error text, duplicate or conflicting records, child-start evidence, spawn results, and saved bindings cannot use this recovery path.Source changes are in
packages/sage-codex/runtime/identity.mjsand its documentation. Generated plugin files come fromnpm run build. The existing failure reconciler consumes the new evidence; this adds no orchestration API or Claude hook changes.Verification on bdd90dc
All test commands used fake
ps,pgrep, andkillfirst on PATH. In the commands below,SAGE_FAKE_PROCESS_BINnames that prepared test directory. Native validation also used the synthetic machine identity guard.npm run build—built 306 files.npm run check—all checks pass.env -u NODE_TEST_CONTEXT PATH="$SAGE_FAKE_PROCESS_BIN:$PATH" npm test -- --test-concurrency=1— exit 0; 1,378 tests, 1,378 pass, 0 fail, 0 cancelled, 0 skipped.env -u NODE_TEST_CONTEXT PATH="$SAGE_FAKE_PROCESS_BIN:$PATH" node --test --test-name-pattern='T65:|T63:|native failed dispatch' scripts/codex-server.test.mjs— 21 tests, 21 pass, 0 fail. This includes the four new capacity groups, existing unknown-model controls, and merged interrupted-run controls. Production behavior is unchanged by the subsequent probe-only repairs and reader comment correction.env -u NODE_TEST_CONTEXT PATH="$SAGE_FAKE_PROCESS_BIN:$PATH" SAGE_TEST_MACHINE_ID=native-fixture node scripts/probe-codex-lifecycle.mjs --sage-capacity-rejection— exit 0, verified true, temporary profile removed. Native limit one and Sage limit two: three reservations, one rejected dispatch, two bindings, two completed children. The first completion remains intact after native residency eviction; the fresh retry completes. Native output reports 12 root requests, five child requests, zero failed turns, unexpected items, malformed events, or rejected fixture requests.The native check uses the actual supported CLI with simulated model responses. It does not prove real-model behavior or installed automatic Sage.
Regression and negative-control proof
A detached
origin/mainworktree at4162ac3bf41951018f0373ca551f363dc6cc6d90received the exact final test file. Running theT65:selector produced four tests, zero pass, four fail. These are behavioral failures: main records no failure receipt and refuses the eligible retry. The four groups cover inherited/explicit models and exact release; forged, changed, duplicate, and conflicting evidence; live-child ambiguity and off-mode history; and reconciliation before the next spawn.An isolated negative control changed only the exact capacity-error comparison to a prefix comparison. The text-variant test failed with
1 !== 0: the altered reader incorrectly released a reservation for extra error text. The production comparison remains exact. All proof worktrees and copies were removed.Native fixture repairs
Early checks exposed fixture defects, which were diagnosed before another run:
Final validation and limits
Two independent code, security, and QA review cycles are clean on the final head. The full serial repository suite passed all 1,378 tests. Exact-head CI run 38781017736 also passed: tests 1378, pass 1378, fail 0, cancelled 0, skipped 0. Required-hook failure recovery, active-child restart, cross-session transfer, and automatic Sage activation remain outside this change.