Skip to content

(restore): follow a session's continuation instead of resuming the pre-fork transcript - #520

Merged
devsuitup merged 8 commits into
mainfrom
wt/518
Oct 9, 2026
Merged

devsuitup merged 8 commits into
mainfrom
wt/518

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Part B of #518 (part A, the live re-key from the CLI descriptor, waits for #477).

When a session is sent to the background, the CLI appends a continued-in record to the old transcript naming the new session id. Restore and the sidebar ignored it and resumed the pre-fork transcript.

Now:

  • The session cache indexes continued-in records while scanning (bounded streaming fallback for stale indexes).
  • Restore follows the chain (cycles and depth bounded). One terminal continuation: open it and rewrite the saved working-set entry. Several: nothing is spawned, the user picks. Cycle, missing target or scan limit: nothing is spawned, the user is told.
  • A continuation that is a live background job goes through the existing attach path.
  • A manual click on the old sidebar row offers the continuation instead of silently resuming the old transcript.
  • Canary test pinning the undocumented continued-in field names.

Red-first: the first commit adds the tests alone (they fail on main); the second adds the fix.

Harness-Claim: true
Agent: switchboard-dev
Host: ANCHOR
Base-Ref: origin/main
Base-SHA: 9c0e827
Claimed-At: 2026-10-09T16:09:37.9634719Z
Nonce: c7a9f6b2381345a8
… pre-fork transcript (#518)

The CLI records a backgrounded session's new id as a continued-in record in
the old transcript; restore and the sidebar ignored it and resumed the old one.
@devsuitup

Copy link
Copy Markdown
Owner Author

Data point for the resolution rules, measured on the reporting machine:

  • Of 7615734f's two continued-in targets, e7abbcdc has a transcript, but c1329340 has no .jsonl anywhere under ~/.claude/projects. Its job is done with no linkScanPath.
  • A missing target should therefore be dropped from the candidates when another one exists, not turn the whole resolution into "unresolved". Otherwise this real case always asks instead of opening e7abbcdc.

…tic restore non-blocking

Parse errors only hold a session when continuation bytes are involved, scans
complete without a total cap, automatic restore holds ambiguous entries in a
notice instead of a modal, and a manual open can still choose the original.
…d for indexing, keep a live new continuation
…wn liveness as unresolved, reuse the full-read index
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