From 4cb1374755b4c6563205d19811e1b224587ff16d Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Wed, 18 Mar 2026 17:03:27 -0400 Subject: [PATCH] fix: invalidate caches inside discuss loop to detect newly written slice context (#1249) After discussing a slice, the LLM writes S0x-CONTEXT.md. The discuss loop re-evaluates but hits stale parse caches, showing the slice as 'not discussed' even though the context file exists on disk. Added invalidateAllCaches() at the top of each loop iteration. Fixes #1244 --- src/resources/extensions/gsd/guided-flow.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/resources/extensions/gsd/guided-flow.ts b/src/resources/extensions/gsd/guided-flow.ts index 04852c73f..58612676e 100644 --- a/src/resources/extensions/gsd/guided-flow.ts +++ b/src/resources/extensions/gsd/guided-flow.ts @@ -507,6 +507,9 @@ export async function showDiscuss( // Loop: show picker, dispatch discuss, repeat until "not_yet" while (true) { + // Invalidate caches so we pick up CONTEXT files written by the just-completed discussion + invalidateAllCaches(); + // Build discussion-state map: which slices have CONTEXT files already? const discussedMap = new Map(); for (const s of pendingSlices) {