Skip to content

fix(sessions): an empty transcript copy no longer makes a session unresumable (v0.471.1) - #908

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/resume-empty-transcript
Nov 19, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/resume-empty-transcript

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

A resume's credential dir could hold a copy of the conversation with no turns while the real one sat in another root (an archived <name>.orphan-* dir). Staging treated the empty copy as present, so claude --resume answered "No conversation found" and the --session-id fallback answered "Session ID … is already in use" — the session could never reopen. The [r] key never ran prepare_resume, so it couldn't recover either.

  • transcriptHasTurns() → true / false / undefined (unreadable = may be real, never set aside).
  • stageResumeTranscript: looks past a KNOWN-empty copy; copies the real one first, then renames the empty one to .empty-<ts> (never deleted), restoring on failure. Audited session.transcript.empty-replaced.
  • findTranscript: ranks copies with turns above empty ones; preferRoot still wins outright.
  • claude-launch.sh: [r] runs prepare_resume before resuming.

Authored by the globex engineer agent (no push access); applied + verified here: typecheck, both bundles, resume-transcript-stage-test 45/45, npm run test:governance exit 0.

🤖 Generated with Claude Code

…esumable (v0.471.1)

A resume's credential dir can hold a copy of the conversation with no turns while the real one sits in
another root (an archived `<name>.orphan-*` dir). Staging read the empty copy as "present" and copied
nothing, so `claude --resume` said "No conversation found" and the `--session-id` fallback said
"Session ID ... is already in use". The session could never be reopened.

- transcriptHasTurns(): true / false / undefined (unreadable = may be real).
- stageResumeTranscript: look past a KNOWN-empty copy; copy the real one first, then set the empty one
  aside (.empty-<ts>), restoring it if the swap fails.
- findTranscript: rank copies with turns above empty ones; preferRoot still wins outright.
- claude-launch.sh: the [r] key runs prepare_resume before resuming.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit 155f0b6 into main Nov 19, 2026
@vikasprogrammer
vikasprogrammer deleted the feat/resume-empty-transcript branch November 19, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant