fix(claudecode): adopt the parent's Claude Code session on a fork child #284
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 336 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #284"
general
weight: 0.35
aramase
A memory-tier fork clones the parent's compute, so the child's harness memory holds the parent's Claude Code session under the parent's UID and nothing under the child's. Every child turn then failed with
errStateLost. This fixes that inside the harness, with no proto, capability or spec change. Fixes #255.claude --resume <parent id> --fork-session --session-id <child id>. Later child turns resume the child's id. The parent's entry is only read.errStateLost.ForkSafestays false; it still means a fork by replay is not supported. The package doc,docs/harness-authoring.mdand a changelog fragment describe the new behavior.Tested:
go vet,gofmtandgo test -raceinintegrations/claudecode, including new fake-claude tests for adoption, the fail-closed cases, a new fork adopting again after the parent's next turn, child retries against an unchanged, advanced or busy parent, an unconfirmed parent, a fork of a fork, and the parent reservation (a paused child refusing the parent's turn, release on every exit path, retries, concurrent forks).TestForkOverWire:controller.Forkon a real parent journal, then the child under its own UID over harnesswire.--resume P --fork-session --session-id Creports C, leavesP.jsonlbyte-identical and writes a self-containedC.jsonl.--session-idwith--resumeand no--fork-session, a child id already in use, and a missing parent transcript each exit 1.