capture a forked session's real id from its init event

A --fork-session branch is spawned without --session-id, so claude mints
a new session id that only arrives in the init event; the ManagedSession
was left holding its placeholder. StreamJsonSession now captures
session_id from the first event that carries it and exposes it via
claudeSessionId / sessionIdResolved; the orchestrator folds that back into
ManagedSession.sessionId (idempotent for normal sessions). A fork can now
itself be resumed or forked.

T-185.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-31 12:21:56 +02:00
co-authored by Claude
parent d0ad8ed4aa
commit e866da9fd8
7 changed files with 79 additions and 4 deletions
+3
View File
@@ -18,6 +18,9 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
### Fixed
- A forked Claude session now reports its real session id (captured from the
branch's `init` event) instead of the placeholder it was spawned with, so a
fork can itself be resumed/forked. (T-185)
- Claude replies now stream token-by-token. The `--include-partial-messages`
output arrives as `stream_event` deltas (not `assistant`+`partial:true` as
first assumed), so the previous handler never fired; the session now reads the