Q69: provider failures classify by status and code; cooldowns follow Retry-After or back off

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 12:03:37 -04:00
1 parent 4325dfa874
commit c6a0460035
15 files changed
+198 -41

No files matched your search

@@ -0,0 +1,12 @@
import { TRANSIENT_PROVIDER_FAILURE_SIGNATURES } from "../../../shared/provider-runtime-domain";
/** Runs record whether they failed for a passing provider reason; older rows are classified from their message once, here. */
export const runFailureKindSchema = `
alter table task_runs add column failure_kind text check (failure_kind in ('transient'));
update task_runs set failure_kind = 'transient'
where state = 'failed' and (${TRANSIENT_PROVIDER_FAILURE_SIGNATURES.map((signature) => `lower(error_message) like '%${signature.replaceAll("'", "''")}%'`).join(" or ")});
insert into schema_migrations(version, name, applied_at)
values (74, 'run_failure_kind', datetime('now'));
`;
+2
View File
@@ -72,6 +72,7 @@ import { runActionsSchema } from "./migrations/070-run-actions";
import { backgroundPollFailuresSchema } from "./migrations/071-background-poll-failures";
import { spendSchema } from "./migrations/072-spend";
import { usageWindowTokensSchema } from "./migrations/073-usage-window-tokens";
import { runFailureKindSchema } from "./migrations/074-run-failure-kind";
interface Migration {
version: number;
@@ -153,6 +154,7 @@ const MIGRATIONS: Migration[] = [
{ version: 71, name: "background_poll_failures", sql: backgroundPollFailuresSchema },
{ version: 72, name: "spend", sql: spendSchema },
{ version: 73, name: "usage_window_tokens", sql: usageWindowTokensSchema },
{ version: 74, name: "run_failure_kind", sql: runFailureKindSchema },
];
const SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1].version;