Repository navigation
fix: keep failed Claude forks from resuming a missing conversation - #208548
Conversation
Keep the ID from a zero-turn Claude error for diagnostics without reporting it as a resumable fork successor. An initialized session still publishes its ID immediately. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97a58aa0-b651-4c4b-8c36-23400ffec1d4
|
🦞👀 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 prevents a zero-turn Claude error from publishing a nonexistent conversation ID as a fork successor. Example: A fork's first /compact fails because checkpoint 11111111-2222-3333-4444-555555555555 is missing.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a current fork-continuity defect with a focused change and no actionable review findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherClaude CLI output enters the streaming parser, which separates diagnostic session IDs from successor notifications consumed by the existing durable session-binding writer. flowchart TD
A[Fork compaction request] --> B[CLI executor]
B --> C[Claude Code]
C --> D[Streaming parser]
D --> E[Diagnostic output]
D --> F[Successor notification]
F --> G[Session binding writer]
Technical reviewBest possible solution: Keep diagnostic IDs in parser output while notifying the existing successor writer only when Claude has established a usable child session. Do we have a high-confidence way to reproduce the issue? Current-main parsing and successor persistence establish the failure path, and the supplied paired Gateway captures show its user-visible result without requiring model inference. Is this the best way to solve the issue? The patch fixes the invalid notification at its producer using existing owners, preserves initialized-child publication, and leaves checkpoint selection and recovery classification intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 294bf1bc5506. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests +5. Total +13 across 2 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:
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 Reviewed November 29, 2026, 2:54 PM ET / 19:54 UTC. |
…208548) Keep the ID from a zero-turn Claude error for diagnostics without reporting it as a resumable fork successor. An initialized session still publishes its ID immediately. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97a58aa0-b651-4c4b-8c36-23400ffec1d4 (cherry picked from commit f122f56) Companion audit: 634d623 is not applicable: it observes Claude compaction summaries through a separate lifecycle callback, not session ID publication. No PR/SHA mentions. Co-authored-by: RomneyDa <[email protected]>
…208548) Keep the ID from a zero-turn Claude error for diagnostics without reporting it as a resumable fork successor. An initialized session still publishes its ID immediately. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97a58aa0-b651-4c4b-8c36-23400ffec1d4 (cherry picked from commit f122f56) Co-authored-by: RomneyDa <[email protected]>
…penclaw#208548) Keep the ID from a zero-turn Claude error for diagnostics without reporting it as a resumable fork successor. An initialized session still publishes its ID immediately. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97a58aa0-b651-4c4b-8c36-23400ffec1d4
Related: #181254 and #192050.
What Problem This Solves
If the first action in a forked Claude Code chat is
/compactand Claude rejects the inherited checkpoint, a second/compactsays “No conversation found with session ID.” OpenClaw saved the ID from Claude’s first error even though there was no conversation to resume.User Impact
A retry stays on the fork at its original checkpoint. If the checkpoint is still missing, Claude reports that same problem rather than looking for a nonexistent conversation. The parent is unchanged. This prevents new bad bindings; it does not restore a missing checkpoint or repair a previously saved ID.
Why This Change Was Made
Claude includes a session ID even in a terminal error reporting zero turns. The stream parser keeps that ID for diagnostics but does not announce it as a fork successor. An initialized child can still be saved as soon as it announces itself, preserving the crash recovery in #208048. The checkpoint classifier from #181308 is unchanged. #192050 concerns a different write: settlement after another writer clears or replaces a binding.
Evidence
I ran the same two
sessions.compactcalls through built Gateways on Crabbox AWS with real Claude Code 2.1.308. I seeded a synthetic parent whose recorded checkpoint was absent from its native transcript and forked it throughsessions.create. Both runs checked Claude’s arguments and results against the child’s SQLite binding after each call. Neither required model inference.4edf0cffb72198d7c1ec6d…and cleared the fork flag. No transcript existed for that ID./compact--resume d7c1ec6d…. Claude reported “No conversation found.”--resume <parent> --fork-session --resume-session-at <checkpoint>. Claude rejected the same missing checkpoint.The parent binding stayed unchanged on both revisions. The regression failed on main when the successor writer received the error ID. On the fixed head the regression and all five focused test files passed, along with the runtime build, core typecheck, scoped lint, and formatting. AWS checks. I tested the rejection, not the process that removed the checkpoint or a successful live-model compaction.
Second compaction, same scenario. These are terminal captures of the actual Gateway CLI response. Main targets the missing conversation; the fix reports the missing checkpoint instead.
Main
Fix
The published head adds only the publication marker; its Git tree is identical to the tested fixed commit.
Reported and co-authored by @daniel-lxs.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by
🦞 Made with OpenClaw