mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-09 03:20:56 +00:00
Three places translated a provider error code into a ProviderErrorKind: error_from_status_code for HTTP error bodies, and a private table in each of the openai_responses and anthropic_messages stream decoders. The tables disagreed, so the same failure classified differently depending on which path saw it. Most visibly, OpenAI returns HTTP 429 with error.type "insufficient_quota" when an account is out of credit. The streaming decoder mapped that to QuotaExceeded, but the non-streaming path fell through to the plain 429 => RateLimit arm, so a spent quota was retried with backoff and never triggered failover. Move the code table into error.rs as kind_from_error_code, returning None when the code says nothing so each caller keeps its own default. All three call sites now share it. In error_from_status_code, unambiguous statuses (401, 403, 404, 408, 413, 5xx) still win outright. A 429 defers to the code only when it reports a spent quota. Ambiguous statuses (400, 422, ...) prefer the structured code over the existing message-substring guessing, which now runs only when there is no code. Two classifications improve as a side effect of merging the tables: not_found_error now maps to NotFound rather than Server for openai, and request_too_large maps to ContextLength rather than InvalidRequest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| fabro-acp | ||
| fabro-agent | ||
| fabro-automation | ||
| fabro-checkpoint | ||
| fabro-dump | ||
| fabro-environment | ||
| fabro-github | ||
| fabro-graphviz | ||
| fabro-hooks | ||
| fabro-install | ||
| fabro-interview | ||
| fabro-llm | ||
| fabro-manifest | ||
| fabro-mcp | ||
| fabro-mcp-store | ||
| fabro-sandbox | ||
| fabro-slack | ||
| fabro-store | ||
| fabro-tool | ||
| fabro-tracker | ||
| fabro-validate | ||
| fabro-variable | ||
| fabro-workflow | ||