Repository navigation
Conversation
A compaction boundary can name a logical parent that never reaches the session file while its preserved tail stays in place. The ownership walk dropped every later record, so the guard read an older phase's Reads as the current message and denied each retry as cross_phase_batch. Continue such a boundary from the preserved tail. A logical parent that is the list's own tail may be unflushed and still supplies no ownership. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Review of the compaction fix found two inputs it had widened by accident: a boundary whose logical parent cycles back without being the list's tail, and a resumed fork whose first record is the boundary. Both behave as before again. Adds tests for a mismatched tail and for a list with no record in the file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
vilano93
marked this pull request as ready for review
November 9, 2026 09:41
Contributor
|
Thanks @vilano93, this is a clear diagnosis backed by a real replay. On main at 119ed92, |
3 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 9, 2026
* Keep /autoplan working after a Claude Code 2.1.317 compaction (#4200) On 2.1.317 a compact boundary's logicalParentUuid names a record the session file never receives, and the preserved list ends with the last record kept in place. The journal reader required that tail to equal the logical parent, so the boundary became an orphan, every later record was dropped, and each phase entry was refused on every retry. The reader now accepts a preserved list whose last entry is the segment's tail, and continues a boundary whose logical parent is absent from the file from that tail. The 2.1.300 path is unchanged: when the tail is the logical parent it still needs the boundary cycle, so an unflushed tail supplies no ownership. A boundary that opens the file stays a resumed fork's root, and lists naming no node of this session still continue nothing. Co-authored-by: vilano93 <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Say the troubleshooting guide's compaction note covers Claude Code 2.1.317 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: vilano93 <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
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.
/autoplan now keeps working after Claude Code compacts a long session, so a run no longer gets stuck between two phases.
Why (in your own words)
In a long /autoplan run on Claude Code 2.1.317, the design phase closed normally and the next phase could never start. Every entry was refused with
cross_phase_batch("one message enters two phases"), even when the Read was alone in its message, and retrying could not help. The cause is the compaction, not the message. Its boundary named alogicalParentUuidthat never reaches the session file, while the preserved tail stays in place. The tail no longer equals the logical parent, so the 2.1.300 handling did not apply, the boundary was orphaned, and every record after it was silently dropped. The guard then took the last Reads before the compaction for the current message. The change continues such a boundary from the preserved tail. I do not know why Claude Code leaves that record out; the reader only stops depending on it.Live evidence
Regression tests before the fix, on a boundary of that shape:
That run had 13 tests; review added 4 more, see Scope.
After the fix, rebased on current main:
Replay of the real 2.1.317 session journal, cut just before the first refused Read and evaluated with
evaluatePayloadPublication. Only counts and tool names are shown, the journal itself stays private:The AFTER run first returned allow=true. Repeated on the final commit it returns
close_stale, the same as on the commit before the review fixes: the plan file changed after the journal cut, so the guard correctly refuses a stale packet. The refusal this PR fixes is gone in both.The boundary in that journal:
logicalParentUuidoccurs nowhere in the file,preservedSegment.tailUuidequals the last entry ofpreservedMessages.uuidsand is a node written before the boundary.Scope
preservedUuidsaccepts a list whose last entry is the segment's tail, without requiring the tail to be the logical parent.ownedCausalOrderresumes from the preserved tail when the logical parent is absent from the file. A logical parent that is the list's own tail may be unflushed and still supplies no ownership, covered by a test. A cycling boundary whose list omits its logical parent stays refused, and a resumed fork that begins with the boundary stays a genesis root; both were widened by the first commit and restored after review, each with a test seen red first. A mismatched tail and a list with no record in the file are also covered; the mismatch test fails when the tail check is removed. Adds a CHANGELOG fragment.bun run typecheck.bun run test:quickfails locally in areas this change does not touch (browse, CSO and Bun resolution tests, from a checkout under/private/tmpwith no built binaries), so the fork CI is the full free-suite signal. The /ship test lane did not pass locally: it hit the 600 s pregate limit, and CI carry does not accept fork runs. The setup was a manualbun install --frozen-lockfilerather thanbin/dev-setup, and this branch was not symlinked as the live install.Liveness proof (required for external contributors)
Checklist
GSTACK PRtyped live into a real surface) or PR author is@garrytan(owner exemption)🤖 Generated with Claude Code