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
This commit is contained in:
Tom Boucher 2026-03-18 17:03:27 -04:00 committed by GitHub
parent 7e2ca68161
commit 4cb1374755

View file

@ -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<string, boolean>();
for (const s of pendingSlices) {