fix: harden degraded source handling
All checks were successful
Codex Template Compliance / template-compliance (pull_request) Successful in 7s
Build / test-and-image (pull_request) Successful in 53s

This commit is contained in:
2026-07-07 21:16:24 +02:00
parent cd19c857f3
commit 62d9c680b7
10 changed files with 199 additions and 33 deletions

View File

@@ -61,12 +61,13 @@ export async function runSource(name, fn, ...args) {
const hasError = Boolean(data?.error);
const degradedStatuses = ['no_credentials', 'no_key', 'disabled', 'degraded', 'failed', 'error'];
const isDegraded = hasError || degradedStatuses.includes(data?.status);
const error = data?.error || data?.configWarning || data?.message || null;
return {
name,
status: isDegraded ? 'degraded' : 'ok',
durationMs: Date.now() - start,
data,
error: hasError ? data.error : null,
error: isDegraded ? error : null,
};
} catch (e) {
return { name, status: 'error', durationMs: Date.now() - start, error: e.message };