fix: treat auto-discovered verification failures as advisory, not blocking (#1188)
When the verification gate auto-discovers commands from package.json (typecheck, lint, test), failures on pre-existing errors create a doom loop: execute → fail → auto-fix → still fails → retry exhausted → pause. The agent can't fix pre-existing lint/test errors it didn't introduce. Now, when discoverySource is 'package-json', gate failures are logged as warnings and the task proceeds without triggering the retry loop. Explicitly configured checks (via preferences or task plan verify field) still trigger the full retry cycle. This preserves the safety of user-configured verification while preventing auto-discovered checks from blocking on inherited tech debt. Fixes #1186
This commit is contained in:
parent
5b36754a19
commit
c442e2d97e
1 changed files with 14 additions and 0 deletions
|
|
@ -175,6 +175,20 @@ export async function runPostUnitVerification(
|
|||
s.verificationRetryCount.delete(s.currentUnit.id);
|
||||
s.pendingVerificationRetry = null;
|
||||
return "continue";
|
||||
} else if (result.discoverySource === "package-json") {
|
||||
// Auto-discovered checks from package.json may fail on pre-existing errors
|
||||
// that the current task didn't introduce. Don't trigger the retry loop —
|
||||
// log a warning and let the task proceed (#1186).
|
||||
process.stderr.write(
|
||||
`verification-gate: auto-discovered checks failed (source: package-json) — treating as advisory, not blocking\n`,
|
||||
);
|
||||
ctx.ui.notify(
|
||||
`Verification: auto-discovered checks failed (pre-existing errors likely). Continuing without retry.`,
|
||||
"warning",
|
||||
);
|
||||
s.verificationRetryCount.delete(s.currentUnit.id);
|
||||
s.pendingVerificationRetry = null;
|
||||
return "continue";
|
||||
} else if (autoFixEnabled && attempt + 1 <= maxRetries) {
|
||||
const nextAttempt = attempt + 1;
|
||||
s.verificationRetryCount.set(s.currentUnit.id, nextAttempt);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue