From 742e26abc1f6d6dbcd02bde583f24664848a1f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=82CHES?= Date: Fri, 13 Mar 2026 23:20:48 -0600 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/resources/extensions/gsd/auto.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/resources/extensions/gsd/auto.ts b/src/resources/extensions/gsd/auto.ts index ceb35b6f1..dd70365cb 100644 --- a/src/resources/extensions/gsd/auto.ts +++ b/src/resources/extensions/gsd/auto.ts @@ -1144,6 +1144,19 @@ async function dispatchNextUnit( "warning", ); + // Close out the previously active unit before overwriting currentUnit. + if (currentUnit) { + const modelId = ctx.model?.id ?? "unknown"; + snapshotUnitMetrics( + ctx, + currentUnit.type, + currentUnit.id, + currentUnit.startedAt, + modelId, + ); + saveActivityLog(ctx, basePath, currentUnit.type, currentUnit.id); + } + // Dispatch fix-merge as the next unit (early-dispatch-and-return) const fixMergeUnitType = "fix-merge"; currentUnit = { type: fixMergeUnitType, id: fixMergeUnitId, startedAt: Date.now() };