Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/resources/extensions/gsd/guided-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,10 @@ export async function showDiscuss(
return;
}

// Ensure DB is open before deriving state (#5837).
const { ensureDbOpen } = await import("./bootstrap/dynamic-tools.js");
await ensureDbOpen(basePath);

// Invalidate caches to pick up artifacts written by a just-completed discuss/plan
invalidateAllCaches();

Expand Down Expand Up @@ -1551,14 +1555,6 @@ export async function showDiscuss(
return;
}

// Ensure DB is open before querying slices (#2560).
// showDiscuss() is a command handler — unlike tool handlers, it has no
// automatic ensureDbOpen() call. Without this, isDbAvailable() returns
// false on cold-start sessions and normSlices falls to [] → false
// "All slices complete" exit.
const { ensureDbOpen } = await import("./bootstrap/dynamic-tools.js");
await ensureDbOpen();

// Guard: no roadmap yet (unless DB has slices)
const roadmapFile = resolveMilestoneFile(basePath, mid, "ROADMAP");
const roadmapContent = roadmapFile ? await loadFile(roadmapFile) : null;
Expand Down
Loading