cd5fb760a5
resumeSession's warm-cache fast-path once again trusted the storedSessionId -> runtimeId -> ClientSessionState mapping without checking the cached state still BELONGS to the session being resumed. A pooled profile backend that gets idle-reaped and respawned re-mints runtime ids, so a recycled id resolves to a live-but-DIFFERENT session's cache entry and paints the wrong transcript under the current route: click thread A, a totally different thread (often from another worktree) loads. The session.usage 404 guard only catches a fully-dead id; a recycled-live id 200s, so the fast-path happily served the stale cache. Straight regression, not a new bug.f7bf74064("reject cross-wired runtime-id cache on session resume") landed takeWarmCache() + its regression test;62af32efe("keep active sessions aligned with cwd"), rebased off a stale branch, restructured resumeSession and silently reverted both 29 minutes later -- the exact stale-branch squash clobber AGENTS.md warns about ("Squash merges from stale branches silently revert recent fixes"). Re-apply the whole-class fix on top of the current cwd-aligned code: takeWarmCache() validates state.storedSessionId === storedSessionId at BOTH cache reads (the early transcript-keep decision and the fast-path), purging a cross-wired mapping on a miss so it falls through to a full resume that rebinds a correct runtime id. Restore the two regression tests guarding it. Tests: resumeSession warm-cache mapping integrity -- a cross-wired mapping is rejected + purged (the bug), a correctly-wired cache is still served with no needless refetch (no perf regression). Co-authored-by: professorpalmer <professorpalmer@users.noreply.github.com>