Skip to content

Restore Codex child assignments after compaction (T25) - #166

Merged
erickb336 merged 4 commits into
mainfrom
codex/t25-child-recovery
Oct 13, 2026
Merged

erickb336 merged 4 commits into
mainfrom
codex/t25-child-recovery

Conversation

@erickb336

@erickb336 erickb336 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #165
Sage task T25

After native compaction, an assigned Codex child must restore its saved instructions before ordinary work or completion. The new no-argument sage_read_assignment tool returns only the authenticated child's current initial assignment. Every new compaction requires a new verified read. Recovery preserves capacity and remains subject to normal tool permission checks, including when Sage is off.

The source changes live in packages/sage-codex/runtime/; the build regenerates the bundled plugin. Claude's active state-tool and hook work is unchanged.

Validation at e2138a238fb3332a77b3b909e0e449601639bedf:

  • npm run build: built 276 files.
  • npm run check: all checks pass.
  • Final full npm test: 1,084 tests; 1,084 pass; 0 fail, cancelled, skipped, or todo. Exact-head CI run 38401199390 also passed all 1,084 tests, with zero failures, cancellations, or skips.
  • Ten new recovery tests pass locally. All ten fail in a detached worktree at main 6d07519. Some failures are missing APIs; behavior failures include main allowing child work before recovery and missing the asynchronous compaction check.
  • node scripts/probe-codex-lifecycle.mjs --sage-child-repeat-recovery: CLI 0.160.0 completed two native compaction rounds using simulated model responses. Both rounds held tools and completion until the exact assignment arrived. The complete admission journal stayed unchanged during recovery. Report persistence and retry survived transcript removal. The probe removed its temporary profile.
  • The probe scripts alone on main fail with unrecovered_work_ran, showing the missing behavior.
  • Two clean code, security, and QA review cycles on the unchanged final commit.

Every test and probe used fake ps, pgrep, and kill first on PATH.

Not verified: real-model consumption, a real-project pilot, later assignments, shared task/run integration, or installed automatic enforcement. Automatic Sage remains incomplete; see #88. The upstream hook failure remains open.

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

Restore initial Codex child assignments after compaction (T25)

1 participant