test(nvidia): read PROVIDER_BREAKER_FAILURE_STATUSES from chatPredicates.ts

Same root cause as the chat.ts import fix in this PR: the const was extracted out
of chat.ts into chatPredicates.ts, so the nvidia-quota Phase-1 guard (which greps
the source for the `= new Set([...])` declaration to prove 429 was not added to the
breaker classification) must read chatPredicates.ts, not chat.ts. Now 13/0.
This commit is contained in:
Probe Test
2026-07-23 03:58:39 -03:00
parent ba247bedd5
commit b18fa27195

View File

@@ -189,7 +189,11 @@ test("getProviderConcurrencyCap resolves override -> static default -> fallback"
); );
setProviderQuotaOverrides({ nvidia: { concurrency: 3 } }); setProviderQuotaOverrides({ nvidia: { concurrency: 3 } });
try { try {
assert.equal(getProviderConcurrencyCap("nvidia", 99), 3, "override wins over the static default"); assert.equal(
getProviderConcurrencyCap("nvidia", 99),
3,
"override wins over the static default"
);
} finally { } finally {
setProviderQuotaOverrides(null); setProviderQuotaOverrides(null);
} }
@@ -218,13 +222,9 @@ test("nvidia 429 does not trip the provider circuit breaker (unchanged 408/500/5
// is a documentation-alignment guard proving Phase 1 didn't accidentally widen // is a documentation-alignment guard proving Phase 1 didn't accidentally widen
// PROVIDER_BREAKER_FAILURE_STATUSES to include 429 (which would collapse the // PROVIDER_BREAKER_FAILURE_STATUSES to include 429 (which would collapse the
// per-model lockout this PR adds into a whole-connection/provider outage). // per-model lockout this PR adds into a whole-connection/provider outage).
const chatHandlerPath = path.join( // The PROVIDER_BREAKER_FAILURE_STATUSES declaration was extracted from chat.ts into
process.cwd(), // the sibling chatPredicates.ts (chat.ts now imports it); read it from its home.
"src", const chatHandlerPath = path.join(process.cwd(), "src", "sse", "handlers", "chatPredicates.ts");
"sse",
"handlers",
"chat.ts"
);
const source = fs.readFileSync(chatHandlerPath, "utf8"); const source = fs.readFileSync(chatHandlerPath, "utf8");
const match = source.match(/PROVIDER_BREAKER_FAILURE_STATUSES\s*=\s*new Set\(\[([^\]]+)\]\)/); const match = source.match(/PROVIDER_BREAKER_FAILURE_STATUSES\s*=\s*new Set\(\[([^\]]+)\]\)/);
assert.ok(match, "PROVIDER_BREAKER_FAILURE_STATUSES declaration found"); assert.ok(match, "PROVIDER_BREAKER_FAILURE_STATUSES declaration found");