Skip to content

Connect native Codex completion to admission (T22) - #160

Merged
erickb336 merged 2 commits into
mainfrom
codex/t22-native-completion
Oct 13, 2026
Merged

erickb336 merged 2 commits into
mainfrom
codex/t22-native-completion

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

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 in packages/sage-core/. Generated plugin files came from the build. Claude's active hook and state-tool work remain untouched.

Validation

Fake ps, pgrep, and kill were first on PATH for test runs. FAKE_PROCESS_BIN below 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 head c4b6af087e74267936799050270ab89c9f3e28b6.

Baseline proof: a detached worktree at main 5b57bb6 received 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-completion passed 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, and temporaryRootRemoved: true.

The same probe without a flag and with --deny-spawn also 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.

@erickb336
erickb336 marked this pull request as ready for review October 13, 2026 11:52
@erickb336
erickb336 merged commit 610d2a6 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.

Connect native Codex completion to terminal admission (T22)

1 participant