SIGN IN SIGN UP

fix(harness-claude-code): resume the exact conversation (#19102)

Stacked on #19100.

## Background

Resume currently uses the SDK's `continue: true`, which means "most
recent thread in this workdir". Once a second thread exists there,
resume silently picks the wrong conversation.

## Summary

- The bridge tracks the Claude session id from the message stream and
reports it in its stop reply.
- The adapter records it in the state returned by `stop()`, `detach()`,
and `suspendTurn()`, and resumes with the SDK's `resume` option. State
from older versions falls back to `continue`.
- The id is also exposed as `harnessMetadata['claude-code'].sessionId`
on `finish` parts, so a UI can show `claude --resume <id>`.
- Resume state is now parsed through the zod schema instead of a cast.

## End-to-End Verification

Ran against the real `claude` CLI: the id streamed on finish metadata
matches the one recorded by `stop()`, and a resumed session recalls
prior turn content without re-reading files.

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

---------

Co-authored-by: Felix Arntz <felix.arntz@vercel.com>
G
George committed
e79bc7afdc1a040eda59312da15e1271bfa3e7c4
Parent: 0a0f271
Committed by GitHub <noreply@github.com> on 8/28/2026, 5:34:59 PM