Claude interrupt repair mistakes request diagnostics for tool calls and appends an orphan conversation leaf
Happier CLI 0.2.16 can make an existing Claude conversation unresumable by appending its own incomplete interruption-repair record. Claude then reports "No conversation found" even though the original transcript is still present and parses correctly when the synthetic record is isolated.
Environment: Windows, Claude Code 2.1.306, bundled Claude Agent SDK 0.2.123, remote Agent SDK session with persisted native history.
Confirmed mechanism
repairClaudeTranscriptAfterInterrupt scans message.content for tool-use blocks without first limiting entries to actual assistant conversation records. An api-request-blob can contain a copy of an earlier tool-use message after that tool's real result has already been persisted. The repair scan treats that diagnostic copy as the latest tool call and incorrectly decides its result is missing.
It then appends a synthetic user tool_result containing "Interrupted", with uuid set to the tool-use identifier and isSidechain false, but no parentUuid, sessionId or timestamp. This creates a new orphan foreground leaf rather than a valid continuation of the conversation.
Read-only checks found that the bundled SDK selected only that orphan result instead of the existing conversation chain. The original verified backup returned the expected prior chain. After a reversible repair isolated the synthetic record outside the foreground chain, the SDK returned that prior chain again and native Claude resume succeeded. A continuation in the same Happier session then produced fresh Opus messages and tool activity. No new native conversation was created.
Synthetic reproduction
- Create a disposable persisted Claude transcript with an assistant calling a harmless tool, a matching user tool_result and a subsequent assistant response. Give all conversation records valid identities and parent links.
- Include a later api-request-blob diagnostic record whose message.content copies the earlier assistant tool-use block, as occurs in persisted request diagnostics.
- Run Happier's interruption-repair path used before remote Agent SDK dispatch.
- Observe an unnecessary synthetic Interrupted result appended after the completed conversation, without its native conversation links.
- Read the conversation with getSessionMessages and attempt native resume. Compare with the untouched synthetic fixture.
Expected behavior
Repair must distinguish actual conversation records from request diagnostics and operate on the relevant foreground chain. It must not manufacture a missing result for a tool that already completed. Any necessary repair record must use a valid native message identity, conversation identity, timestamp and parent link. Retrying resume must not replace a valid conversation with an orphan record or silently start a new conversation.
Workaround and limits
At an idle boundary, retain both the untouched original history and a full copy containing the malformed record. Isolate only the redundant synthetic repair record outside the foreground chain, validate the resulting chain with the SDK, and verify native resume before continuing work. This was a manual support recovery, not an upstream fix or proof of reliable automatic failover. Do not blindly delete real tool results or modify an actively written transcript.
No project data, paths, host names, account identifiers, session identifiers, session text, raw logs or screenshots are included. Reproduction uses synthetic data only.
Thanks for documenting the diagnostic-copy trigger and the reversible recovery checks. This matches the defect corrected in #617, merged October 20.
Previously, interruption repair could mistake api-request-blob copies for unanswered tool calls, then append an unlinked synthetic result. The shared repair owner now ignores non-conversation records and gives genuinely needed repair entries valid message identities, timestamps, and parent/session links. Regression tests cover diagnostic echoes, grouped missing results, and repeated repair.
Stable CLI 0.2.16 predates this correction. It will reach stable on the next stable CLI release; please retry once this issue reaches stage:stable.
The correction prevents this corruption but does not recover transcripts already damaged by older versions. Keep the preserved backups; upgrading alone will not repair those files. If the same failure occurs on a corrected build, please share the exact CLI build and smallest synthetic reproduction so we can distinguish another case.
Posted on behalf of @leeroybrun.