fix(session): re-baseline subagent tokens on session adopt

main

Commit

suhaanthayyil2mo ago

Cross-repo session adoption opens a fresh target-local checkpoint window (StepCount=0, CheckpointTokenUsage=nil) but the cloned TokenUsage carries the source session's full cumulative subagent total. Without re-baselining SubagentTokensBaseline, the first post-adopt checkpoint subtracted the source's stale-or-nil baseline and over-reported — potentially the source session's entire subagent usage.

Add a shared session.State.RebaselineSubagentTokens helper so the invariant "every site that starts a fresh checkpoint window must re-baseline" is enforced in one place. Call it from the adopt reset block and from resetCheckpointWindow.