From 84e772f086e28dfeaf46a547a895edb7875097ff Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 17 Mar 2026 10:00:24 -0400 Subject: [PATCH] fix: invalidate caches before initial state derivation in startAuto (#800) (#843) --- src/resources/extensions/gsd/auto.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/resources/extensions/gsd/auto.ts b/src/resources/extensions/gsd/auto.ts index 0ef32e68f..42bd861ae 100644 --- a/src/resources/extensions/gsd/auto.ts +++ b/src/resources/extensions/gsd/auto.ts @@ -944,6 +944,11 @@ export async function startAuto( ctx.ui.notify(`Debug logging enabled → ${getDebugLogPath()}`, "info"); } + // Invalidate all caches before initial state derivation to ensure we read + // fresh disk state. Without this, a stale cache from a prior session (e.g. + // after a discussion that wrote new artifacts) may cause deriveState to + // return pre-planning when the roadmap already exists (#800). + invalidateAllCaches(); let state = await deriveState(base); // ── Stale worktree state recovery (#654) ─────────────────────────────────