docs: track sub2api 2xx classification gap
This commit is contained in:
@@ -79,14 +79,20 @@ if (parsed.pool?.defaultTempUnschedulable?.enabled === true) {
|
||||
}
|
||||
const accountState403Rule = rules.find((rule) => rule.statusCode === 403);
|
||||
const quota429Rule = rules.find((rule) => rule.statusCode === 429);
|
||||
const successBody200Rule = rules.find((rule) => rule.statusCode === 200);
|
||||
const serviceUnavailable503Rule = rules.find((rule) => rule.statusCode === 503);
|
||||
const accountState403Keywords = new Set((accountState403Rule?.keywords ?? []).map((keyword) => keyword.toLowerCase()));
|
||||
const quota429Keywords = new Set((quota429Rule?.keywords ?? []).map((keyword) => keyword.toLowerCase()));
|
||||
const successBody200Keywords = new Set((successBody200Rule?.keywords ?? []).map((keyword) => keyword.toLowerCase()));
|
||||
const serviceUnavailable503Keywords = new Set((serviceUnavailable503Rule?.keywords ?? []).map((keyword) => keyword.toLowerCase()));
|
||||
for (const keyword of ["weekly limit", "less than 10% of your weekly limit left", "run /status for a breakdown"]) {
|
||||
assertCondition(accountState403Keywords.has(keyword), "403 temporary-unschedulable rule must catch Codex weekly-limit account-state prompts", { keyword, accountState403Rule });
|
||||
assertCondition(quota429Keywords.has(keyword), "429 temporary-unschedulable rule must catch Codex weekly-limit quota prompts", { keyword, quota429Rule });
|
||||
}
|
||||
if (successBody200Rule !== undefined) {
|
||||
assertCondition(successBody200Keywords.has("less than 10% of your weekly limit left"), "200 temporary-unschedulable rule must document the weekly-limit success-body classifier phrase", successBody200Rule);
|
||||
assertCondition(/reclassification/u.test(successBody200Rule.description ?? ""), "200 temporary-unschedulable rule must be documented as a reclassification signal, not a proven cooldown", successBody200Rule);
|
||||
}
|
||||
for (const keyword of ["model_not_found", "no available channel for model"]) {
|
||||
assertCondition(serviceUnavailable503Keywords.has(keyword), "503 temporary-unschedulable rule must catch upstream model-routing failures", { keyword, serviceUnavailable503Rule });
|
||||
}
|
||||
|
||||
@@ -668,6 +668,12 @@ export function defaultCodexTempUnschedulablePolicy(): CodexTempUnschedulablePol
|
||||
return {
|
||||
enabled: true,
|
||||
rules: [
|
||||
{
|
||||
statusCode: 200,
|
||||
keywords: ["less than 10% of your weekly limit left"],
|
||||
durationMinutes: 120,
|
||||
description: "Success-body account-state prompts require Sub2API 2xx body reclassification before they can cool accounts.",
|
||||
},
|
||||
{
|
||||
statusCode: 401,
|
||||
keywords: ["unauthorized", "invalid api key", "invalid_api_key", "authentication", "recovered upstream error"],
|
||||
|
||||
Reference in New Issue
Block a user