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:
@@ -614,10 +614,11 @@ export class CollabHost {
|
||||
case "kill": {
|
||||
const kill = async () => {
|
||||
const ref = AgentRegistry.global().get(agentId);
|
||||
if (ref && ref.status === "running" && ref.session) {
|
||||
if (!ref) return;
|
||||
if (ref.status === "running" && ref.session) {
|
||||
await ref.session.abort({ reason: USER_INTERRUPT_LABEL });
|
||||
}
|
||||
await AgentLifecycleManager.global().release(agentId);
|
||||
await AgentLifecycleManager.global().release(agentId, ref);
|
||||
};
|
||||
kill().catch(fail);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user