mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 21:49:42 +02:00
start() reassigns _claudeSessionId to `resumeSessionId || id` on every launch, including the path that re-attaches to a mux session that outlived the restart. A pane whose CLI had moved on via /clear therefore came back pointing the response viewer at its pre-/clear transcript, and because Session.lastSubmitAt lived only in memory, the history correlation had nothing to correct it with until the user happened to type again — observed as hours of the eye showing a conversation the pane had long since left. Persist lastSubmitAt in SessionState, restore it in restoreMuxSessions(), and flush it when the viewer adopts (a /clear emits no completion event, which is the trigger that would otherwise have persisted it). Recovered panes now re-derive their live conversation on the viewer's first poll. Restoring a stale anchor is safe: the resolver already refuses a candidate transcript older than the one the pane is currently on, which is the shape of a respawn into a fresh conversation.