Repository navigation
Refuse terminal Codex child tools after Sage off (T16) - #259
Merged
Merged
Conversation
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 #258
Sage task T16
A tracked Codex child could pass tool policy after its turn ended when Sage was off. The policy now requires the exact native turn to remain active before evaluation and again before permission returns.
The fix preserves ongoing off-mode work, unmanaged off-mode children, and separate completion/interruption recording. A refused tool does not release the reservation or finish its logbook run. Source edits are in
packages/sage-codex/runtime/policy.mjs; plugin output was regenerated through the build.Verification
Final reviewed head:
f6cf267c9f9c05de9b51abf2290c94bc6d3c91ec.npm run build: built 317 files.npm run check: all checks pass (4 documented timing bounds).git diff --check: passed.node --test --test-name-pattern='T16:' scripts/codex-server.test.mjs: tests 9; pass 9; fail 0.npm test: tests 1613; pass 1613; fail 0; cancelled 0; skipped 0.Every test used fake ps, pgrep and kill first on PATH, with NODE_TEST_CONTEXT unset. No timing-based assertion was added.
Regression evidence and fixture repair
On detached main
443c00a, the identical new tests report tests 9; pass 5; fail 4. Each off-mode regression fails with Missing expected rejection, covering completion/interruption before/during awaited evaluation. Five positive controls already pass on main. The final repair did not change those cases.The first full candidate suite reported 1612 passes and one failure: an older message-policy fixture omitted its child transcript. The repair supplies that existing transcript, preserving every assertion and the production checks. Both review cycles restarted after that commit. The final full suite above passes. During initial test development, interruption ingestion was also corrected to use parent reconciliation; those fixture errors are not counted as behavioral regression proof.
Not verified
No live-model or installed-session trial ran for this repair. Tests exercise packaged production policy with transcript fixtures. This cannot revoke a command that already received permission before a later terminal event. Automatic Sage, project-wide PR ownership, upstream trusted execution context and abrupt-loss recovery remain separate work under #88. Claude-owned work is unchanged.