Skip to content

Commit d4a2f34

Browse files
gewenyu99claude
andcommitted
agent-runner: don't abort non-interactive runs on a health-check outage
The TUI lets the user continue past a service outage; non-interactive runs (CI) had no such escape and aborted with exit 1 on a transient upstream blip (e.g. Anthropic "degraded"). Mirror the TUI's continue-anyway automatically: still report the degraded services, then proceed instead of aborting. Health checks are advisory in CI, not a gate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 620f197 commit d4a2f34

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

src/lib/agent/agent-runner.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
} from '@utils/debug';
5656
import { createBenchmarkPipeline } from '@lib/middleware/benchmark';
5757
import { wizardAbort, WizardError, registerCleanup } from '@utils/wizard-abort';
58+
import { isNonInteractiveEnvironment } from '@utils/environment';
5859
import { formatScanReport, writeScanReport } from '@lib/yara-hooks';
5960
import { detectNodePackageManagers } from '@lib/detection/package-manager';
6061
import type { PackageManagerDetector } from '@lib/detection/package-manager';
@@ -279,12 +280,17 @@ async function bootstrapProgram(
279280

280281
await getUI().showBlockingOutage(readiness);
281282

282-
await wizardAbort({
283-
message:
284-
'Cannot start — external services are down:\n' +
285-
blockingLabels.map((l) => ` - ${l}`).join('\n') +
286-
'\n\nPlease try again later.',
287-
});
283+
// The TUI lets the user continue past an outage; non-interactive runs
284+
// (CI) do the same automatically — the degraded services are reported
285+
// above, but we proceed rather than aborting on a transient upstream blip.
286+
if (!isNonInteractiveEnvironment()) {
287+
await wizardAbort({
288+
message:
289+
'Cannot start — external services are down:\n' +
290+
blockingLabels.map((l) => ` - ${l}`).join('\n') +
291+
'\n\nPlease try again later.',
292+
});
293+
}
288294
} else if (readiness.decision === WizardReadiness.YesWithWarnings) {
289295
getUI().setReadinessWarnings(readiness);
290296
}

src/ui/logging-ui.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class LoggingUI implements WizardUI {
114114
}
115115

116116
showBlockingOutage(result: WizardReadinessResult): Promise<void> {
117-
console.log(`▲ Service health issues detected — blocking outage.`);
117+
console.log(`▲ Service health issues detected.`);
118118
const blockingKeys = getBlockingServiceKeys(result.health);
119119
if (blockingKeys.length > 0) {
120120
console.log(`│`);
@@ -131,7 +131,9 @@ export class LoggingUI implements WizardUI {
131131
for (const reason of result.reasons) {
132132
console.log(`│ ${reason}`);
133133
}
134-
console.log(`│ The wizard cannot start while these services are down.`);
134+
console.log(
135+
`│ Continuing anyway — health checks are advisory in non-interactive runs.`,
136+
);
135137
return Promise.resolve();
136138
}
137139

0 commit comments

Comments
 (0)