convergeSessions never mints a claude_session_id, so pre-migration-0012 rows can never become resumable #179
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lz/agent-nexus#179
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while auditing the MCP specs, verified by reading
nexus/src/lib/server/sessions/service.ts.The asymmetry
Migration 0012 added
claude_session_id TEXT NOT NULL DEFAULT '', so every session row that predates it carries the empty string. Three code paths relaunch a session, and they handle that state three different ways:openWorkspaceSession(:403)existing?.claude_session_id || randomUUID()— mintssetSessionAgentrestart (:948)updateTableconvergeSessions(:1341)resume: Boolean(row.claude_session_id)— mints nothing, writes nothingAnd
resumeFlag(:119) returns the empty string when the id is empty:So convergence relaunches such a session with no
--session-idand no--resumeat all: a fresh, unpinned conversation each time, and the row stays''— so it can never become resumable. The restart path would fix the row, but only if the operator happens to use it.Severity
Low blast radius, permanent effect. It reaches only rows created before 0012 ran, but for those the conversation is lost on every restore, silently, forever.
Fix
Make
convergeSessionsmint-and-persist like the restart path does, then launch with--session-id. The comment at:400already explains the intent — "a freshly-minted id has no conversation yet, so only--resumewhen there's a real pinned id" — and convergence is the one path that implements the first half without the second.Test: a session row with
claude_session_id = ''that goes through convergence must come out with a persisted uuid, and the launch must carry--session-idrather than nothing. Prove it fails first — a test written against the current code that asserts the row is unchanged would pass and prove nothing.Related
Worth doing before the fleet status layer (#177), which changes what drives convergence.