fix: use fixLevel 'all' in post-hook doctor after complete-slice to fix roadmap checkboxes (#839) (#847)

This commit is contained in:
Tom Boucher 2026-03-17 10:01:10 -04:00 committed by GitHub
parent 1868aaeb02
commit 11d0b26858

View file

@ -1381,10 +1381,13 @@ export async function handleAgentEnd(
// fixLevel:"task" ensures doctor only fixes task-level issues (e.g. marking
// checkboxes). Slice/milestone completion transitions (summary stubs,
// roadmap [x] marking) are left for the complete-slice dispatch unit.
// Exception: after complete-slice itself, use fixLevel:"all" so roadmap
// checkboxes get fixed even if complete-slice crashed (#839).
try {
const scopeParts = currentUnit.id.split("/").slice(0, 2);
const doctorScope = scopeParts.join("/");
const report = await runGSDDoctor(basePath, { fix: true, scope: doctorScope, fixLevel: "task" });
const effectiveFixLevel = currentUnit.type === "complete-slice" ? "all" as const : "task" as const;
const report = await runGSDDoctor(basePath, { fix: true, scope: doctorScope, fixLevel: effectiveFixLevel });
if (report.fixesApplied.length > 0) {
ctx.ui.notify(`Post-hook: applied ${report.fixesApplied.length} fix(es).`, "info");
}