fix(coding-agent): persisted vibe sessions across restarts

Vibe worker roster lived only in a process-local Map, so a resumed parent
session started with an empty registry and vibe_send failed with
"Unknown vibe session". Persist a versioned, parent-scoped lifecycle
journal (spawn/turn/tombstone events), rehydrate validated idle workers
through the persisted-subagent reviver on resume, and gate the flow with
generation/CAS protection so stale finalizers cannot clobber a
replacement worker. Killed transcripts stay readable but non-revivable;
mode-exit commits tombstones atomically with the mode change and rolls
back cleanly on storage failure.

Ported from @mastertyko's fork branch fix/vibe-session-persistence.

Fixes #5303
This commit is contained in:
roboomp
2026-07-14 17:58:14 +00:00
parent 01d3fc9b6b
commit 4bc68b45e2
29 changed files with 3919 additions and 229 deletions
@@ -992,7 +992,7 @@ export class CommandController {
}
try {
await this.ctx.sessionManager.moveTo(resolvedPath);
await this.ctx.session.moveSession(resolvedPath);
} catch (err) {
this.ctx.showError(`Move failed: ${err instanceof Error ? err.message : String(err)}`);
return;