Repository navigation
fix(sessions): recover handoffs after cancelled compaction - #5197
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2adb59a1b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed at 2adb59a1b2ef4fc4286633e00590cc7863397512. The acknowledgement belongs in the existing pending-write checkpoint: it prevents replay after compaction changes the append fingerprint, while the exact-history check preserves live rollback retries. The controlled SQLite regression covers committed cancellation with live and JSON-restored state through both runner modes, including stored history and avoiding repeated handoff/model work. The schema extension is confined to unreleased 1.18; released 1.17 remains readable.
I also checked the existing inline concerns. The acknowledged/null-before combination has no supported producer. The JSON rollback concern is a real pre-existing limitation: the base revision also loses the model-exchange evidence on JSON restoration and skips compaction. It should be tracked separately from this committed-cancellation fix; this approval does not establish JSON rollback retry support.
No actionable regression or structural blocker found in this diff. Source review only; all 22 hosted checks passed at this exact head. No tests or builds were run locally.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ef0f2d64a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
This pull request fixes handoff recovery when session compaction commits replacement history during cancellation. Native atomic replacement now drains to a confirmed outcome before cancellation propagates, allowing the Runner to settle its pending checkpoint without repeating persistence or completed handoff/model work. If replacement and restoration fail, the checkpoint remains pending and unrecognized history raises a reconciliation error before further model work.
Exact restored append history still permits compaction retry. The checkpoint retains append acknowledgement plus the successful model exchange's digests and replay policy for live and JSON-restored retries, and rejects acknowledgement without a captured history boundary. These private checkpoint fields extend unreleased RunState schema 1.18; schema 1.17 remains readable. Follow-up to #4835.
Test plan
Issue number
Follow-up to #4835.
Checks
.agents/skills/code-change-verification/scripts/run.sh