fix: cover sub2api model routing 503 cooldown
This commit is contained in:
@@ -29,10 +29,14 @@ assertCondition(!("pool_mode" in credentials), "pool_mode must not be enabled be
|
||||
assertCondition(!("api_key" in credentials) && !("base_url" in credentials), "temporary-unschedulable rendering must not include secrets or endpoints", credentials);
|
||||
const accountState403Rule = rules.find((rule) => rule.error_code === 403);
|
||||
const quota429Rule = rules.find((rule) => rule.error_code === 429);
|
||||
const serviceUnavailable503Rule = rules.find((rule) => rule.error_code === 503);
|
||||
for (const keyword of ["weekly limit", "less than 10% of your weekly limit left", "run /status for a breakdown"]) {
|
||||
assertCondition(accountState403Rule?.keywords?.includes(keyword), "403 rendered rule must preserve Codex weekly-limit account-state keyword", { keyword, accountState403Rule });
|
||||
assertCondition(quota429Rule?.keywords?.includes(keyword), "429 rendered rule must preserve Codex weekly-limit quota keyword", { keyword, quota429Rule });
|
||||
}
|
||||
for (const keyword of ["model_not_found", "no available channel for model"]) {
|
||||
assertCondition(serviceUnavailable503Rule?.keywords?.includes(keyword), "503 rendered rule must catch upstream model-routing failures", { keyword, serviceUnavailable503Rule });
|
||||
}
|
||||
|
||||
const disabled = renderSub2ApiTempUnschedulableCredentials({ enabled: false, rules: policy.rules }) as {
|
||||
temp_unschedulable_enabled?: boolean;
|
||||
@@ -48,6 +52,7 @@ console.log(JSON.stringify({
|
||||
"temporary unschedulable policy renders to Sub2API credential field names",
|
||||
"temporary unschedulable rendering follows the input policy without hard-coded policy gates",
|
||||
"Codex weekly-limit prompt keywords render into 403 and 429 cooldown rules",
|
||||
"upstream model-routing failures render into the 503 cooldown rule",
|
||||
"disabled policies clear runtime rules",
|
||||
],
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user