From 4a43679bc015aaef987d735fb934dc3df7ef2065 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 17 Mar 2026 09:59:13 -0400 Subject: [PATCH] fix: add debug logging to silent early-return paths in dispatchNextUnit (#823) (#836) --- src/resources/extensions/gsd/auto.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resources/extensions/gsd/auto.ts b/src/resources/extensions/gsd/auto.ts index 827172e10..0ef32e68f 100644 --- a/src/resources/extensions/gsd/auto.ts +++ b/src/resources/extensions/gsd/auto.ts @@ -2013,6 +2013,7 @@ async function dispatchNextUnit( pi: ExtensionAPI, ): Promise { if (!active || !cmdCtx) { + debugLog(`dispatchNextUnit early return — active=${active}, cmdCtx=${!!cmdCtx}`); if (active && !cmdCtx) { ctx.ui.notify("Auto-mode session expired. Run /gsd auto to restart.", "info"); } @@ -2022,6 +2023,7 @@ async function dispatchNextUnit( // Reentrancy guard: allow recursive calls from skip paths (_skipDepth > 0) // but block concurrent external calls (watchdog, step wizard, etc.) if (_dispatching && _skipDepth === 0) { + debugLog("dispatchNextUnit reentrancy guard — another dispatch in progress, bailing"); return; // Another dispatch is in progress — bail silently } _dispatching = true;