Repository navigation
Connect native Codex completion to admission (T22) - #160
Merged
Merged
Conversation
erickb336
marked this pull request as ready for review
October 13, 2026 11:52
This was referenced Oct 13, 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 #159
Sage task T22
Result
Codex can release an initial child's admission slot only after its protected transcript proves completion or interruption. A stop callback or reported done status alone retains capacity. The adapter supports no-tool children, Sage off, repeated events, and one native report-field correction without accepting report claims.
Parent reconciliation recovers an early child stop after the matching spawn result arrives. A preliminary security review found this ordering gap; two tests reproduced it before the repair. The reviewer inspected the repair and found no further issue there.
Sources changed:
packages/sage-codex/runtime/and shared report-field helpers inpackages/sage-core/. Generated plugin files came from the build. Claude's active hook and state-tool work remain untouched.Validation
Fake
ps,pgrep, andkillwere first on PATH for test runs.FAKE_PROCESS_BINbelow represents that fixture directory.npm run build: built 271 files.npm run check: all checks pass.git diff --check: pass.env -u NODE_TEST_CONTEXT PATH="$FAKE_PROCESS_BIN:$PATH" node --test --test-name-pattern='initial delivery recovery|native completion|packaged MCP stop|native blocked stop|native status hooks|no-tool completion|native report correction|off-mode ordinary|active-mode ordinary|ordinary native stop|native missed-stop|native interruption recovery' scripts/codex-server.test.mjs: 24 tests, 24 pass, 0 fail, 0 cancelled, 0 skipped.env -u NODE_TEST_CONTEXT PATH="$FAKE_PROCESS_BIN:$PATH" npm test: 1,057 tests, 1,057 pass, 0 fail, 0 cancelled, 0 skipped on final headc4b6af087e74267936799050270ab89c9f3e28b6.Baseline proof: a detached worktree at main
5b57bb6received only the new test file and dependency access. The first 22 new tests failed there. The two later initial-delivery tests also failed there. Most failures reflect missing lifecycle APIs or the absent child-stop module; packaged-hook assertions also fail on main. Separately, both late-result tests failed against the pre-repair implementation: no recovered binding and no transcript validation. They pass after repair. Existing assertions were not changed.Native verification and review
env -u NODE_TEST_CONTEXT PATH="$FAKE_PROCESS_BIN:$PATH" node scripts/probe-codex-lifecycle.mjs --sage-completionpassed with actual CLI 0.160.0 and simulated responses. Final output:verified: true, one reservation, one binding, one completion, two stop receipts before terminal evidence, blocked-stop capacity retained, parent reconciliation complete, zero accepted reports, andtemporaryRootRemoved: true.The same probe without a flag and with
--deny-spawnalso passed. Each owned native process exited and each temporary profile was removed. The deterministic packaged tests force the early-stop/late-parent-result order; the native probe forces a blocked stop, not that separate ordering.Two clean code, security, and QA cycles completed on
c4b6af087e74267936799050270ab89c9f3e28b6. Preliminary reviews did not count. The final-head local suite and CI both pass all 1,057 tests with zero failures, cancellations, or skips. CI run 38392070125 completed successfully on the reviewed commit. All owned local test, probe, and push processes exited.Compacted successful completion is refused in this extraction; verified interruption can still release its exact slot. Later assignments and complete recovery remain in #138. The installed manifest is unchanged. No installed activation, real-model consumption, or complete automatic workflow has been verified. Automatic Sage remains incomplete; see #88.