Repository navigation
fix: keep the latest Claude summary when forking after compaction - #208535
Conversation
Keep the native summary checkpoint on the session whose transcript was compacted. A checkpoint at the boundary itself omits the summary; an earlier assistant UUID can no longer be resumed. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 64b65588-420a-42fa-b160-ca02987118bf
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: passed. What this changesThis PR records Claude’s latest compaction summary checkpoint so subsequent forks can resume usable native history. Example: Run /compact twice in a Claude CLI chat, fork the conversation, then run /compact in the child.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a distinct Claude fork continuity bug still present on main, and no blocking defect was found in the pinned diff. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Anthropic adapter interprets Claude Code JSONL output, the shared CLI runner returns continuity metadata, and the session-store owner persists the checkpoint used when creating native forks. flowchart LR
A[Chat compaction request] --> B[Native CLI compaction owner]
B --> C[Claude Code process]
C --> D[Anthropic JSONL validator]
D --> E[CLI result settlement]
E --> F[Session binding store]
F --> G[Checkpointed child fork]
Technical reviewBest possible solution: Keep summary interpretation in the Anthropic adapter and persist its checkpoint through the existing session-binding owner without changing already-pinned forks. Do we have a high-confidence way to reproduce the issue? The paired Gateway screenshots show the reported failure, and current-main source confirms that manual compaction does not publish the replacement summary checkpoint; this review executed no target code. Is this the best way to solve the issue? The approach repairs checkpoint production at the provider boundary, preserves existing fork pinning, and handles bounded output without introducing another persistence owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9289a879ca1f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +118, Tests +132, Docs +8, Other 0. Total +258 across 23 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 29, 2026, 4:20 PM ET / 21:20 UTC (Revision 3). |
Keep the account guard before fork admission and the summary checkpoint write after native compaction.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…08535) (cherry picked from commit 634d623) Release adaptation: Read positive checkpoint evidence from bounded Claude native-compaction stdout and publish through the exact stable session writer fence; no SDK or schema change. Companion audit: No pinned source-reference companion identified. Stable fork successor and account/auth fences are preserved. Co-authored-by: RomneyDa <[email protected]>
* fix: show Claude CLI document uploads only once in chat * fix: show Claude CLI document uploads only once in chat OpenClaw-Publication: 4555cb04-bff2-43b3-aff8-ec271d6567b2 * fix: keep Claude document uploads on the message that sent them * fix: preserve the released message queue result contract Release adaptation: Use an optional accepted-input observer instead of widening queueMessage's released Promise<void> contract. Reuse the stable steering and transcript-rewrite handlers; leave source admission, native image steering, config, and all SQLite schemas unchanged. The existing history index columns also carry exact document correlation. Keep the released model-hook test layout. Companion audit through be407a4: no later #203866 reference. PRs #208535 (Claude compacted fork summaries), #206158 (native subagent status), and #205663 (image dimensions) are separate. PRs #208252 (Codex source), #207022 (embedded prompt dispatch), #206969 (fallback), #205963 (Copilot question policy), and 50a7368 (snooze) do not own this path. SHA mentions in #204700 and #204685 are update/qualification records, not follow-ups. (cherry picked from commit 269f884) Co-authored-by: RomneyDa <[email protected]>
Check the selected Claude account against the saved native session before manual compaction, including after a restart. A fork can compact on its selected account after its first ordinary turn establishes a native session there. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 34da9584-a62a-4ed5-8cf3-a0b3e6387e25 OpenClaw-Publication: 4527fb28-07bf-43c1-854e-e4a27bd33b16 (cherry picked from commit d680722) Release adaptation: Keep the stable compaction target and System admission. Compare the selected Claude credential with the persisted binding before CLI launch; preserve session-entry identity while publishing diff metadata. Retain stable auto-pin and missing-profile tests, add inherited and persisted-successor regressions, and verify slash/RPC account forwarding. Companion audit: 634d623 (#208535) refreshes the checkpoint after successful compaction; it is not required for rejecting an account mismatch before launch and is handled by the separate w4-14 port (e2fe56f3019). No other referenced follow-up through the pinned scan end. Release adaptation: Integration conflict with 5297bb2 (#208535, preserve latest Claude summary when forking after compaction) resolved by retaining checkpoint publication and importing the account-mismatch guard, which runs before CLI launch. Co-authored-by: RomneyDa <[email protected]>
Check the selected Claude account against the saved native session before manual compaction, including after a restart. A fork can compact on its selected account after its first ordinary turn establishes a native session there. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 34da9584-a62a-4ed5-8cf3-a0b3e6387e25 OpenClaw-Publication: 4527fb28-07bf-43c1-854e-e4a27bd33b16 (cherry picked from commit d680722) Release adaptation: Keep the beta release’s existing System admission wrapper and CLI target plumbing. Forward the session pin separately from the native binding, and add only the auth epoch import needed by the regressions. #208535 separately follows in lane order. Co-authored-by: RomneyDa <[email protected]>
…08535) Record Claude's post-compaction summary as the checkpoint for new forks. Preserve the existing checkpoint when a backend only acknowledges compaction, and keep subsequent child turns on their native session. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 64b65588-420a-42fa-b160-ca02987118bf (cherry picked from commit 634d623) Co-authored-by: RomneyDa <[email protected]>
…enclaw#208535) Record Claude's post-compaction summary as the checkpoint for new forks. Preserve the existing checkpoint when a backend only acknowledges compaction, and keep subsequent child turns on their native session. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 64b65588-420a-42fa-b160-ca02987118bf
Related to #181254.
What problem this solves
After two consecutive
/compactcommands in a Claude CLI chat, a full fork could retain an assistant message UUID that Claude had compacted away. Running/compactas the fork’s first action then failed withNo message found with message.uuid.What changes
A full fork uses the latest summary recorded by Claude. When the child contains only that summary, its first
/compactreports that there are too few messages to compact. An ordinary message continues in the same child, and a later/compactupdates the child’s own summary. The parent keeps its own transcript and checkpoint. Existing forks keep the checkpoint recorded at creation.The Claude adapter reads the summary UUID from the JSONL stream, including summaries that extend beyond the raw stdout capture. An acknowledgement alone keeps the existing checkpoint. An observed Claude compaction boundary invalidates the old checkpoint when Claude supplies no usable summary UUID. The native session binding is updated only when that backend reports a replacement or invalidates the old checkpoint.
Pinning matters because the parent can advance after a fork. The fork still checks the selected Claude account before compaction and keeps the pending fork when Claude rejects the checkpoint before starting a turn. Checkpointed retries · Full forks · Child compaction · Account check · Rejected fork
Verification
I ran fresh AWS Gateways with Claude Code 2.1.332. A loopback Messages endpoint supplied deterministic model replies. Claude Code handled the fork, resume, compaction and native transcript writes.
b943a89e68b1e1/compactin the full fork/compactcreated a new summary in the same child and advanced its count once.Main AWS run · Final PR AWS run
190 focused tests passed across 9 files. The regressions cover acknowledgement-only backends, control-only JSONL acknowledgements, provider-specific skip reasons, and summaries beyond the raw stdout capture. The runtime build, core and extension typechecks, and scoped lint passed. Anthropic account sign-in and billing were outside this run.
Reported by @daniel-lxs.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by
🦞 Made with OpenClaw