Skip to main content

Module provider_error

Module provider_error 

Source
Expand description

Provider error classifier and retry tracker (SCOPE: “Provider errors: classify, retry, escalate”).

Inputs: the rendered PTY screen of a session and ACP turn errors. Four classes:

  • retryable: 429 / 5xx / overloaded / timeout / dropped stream. The node retries the turn itself with exponential backoff, up to MAX_ATTEMPTS (PTY: types “continue”; ACP: the last prompt again).
  • limit: a 5h / 7d window is spent. No retry; the existing limit session signal carries the reset hint and the task manager pauses or moves the work.
  • fatal: 400 bad request, auth, context too long. No retry.
  • unknown: an error-looking line we cannot place. No retry. Only fatal, unknown and retryable with attempts spent escalate (a provider_error session signal to core → one HQ-ERROR letter, the run’s card to blocked). Retries themselves go to the node log only (target provider_retry). Error text is clipped and never carries prompt or screen content beyond the matching line.

Structs§

Found
Tracker

Enums§

Action
Class
Retry

Constants§

MAX_ATTEMPTS

Functions§

backoff
classify_line
Classify one line of provider output.
classify_message
Classify an ACP turn error (message plus the vendor code when present).
classify_screen
The newest provider-API error on a screen (bottom-up, last 12 non-empty lines) and its row from the bottom. Stricter than classify_line: the line must carry an HTTP-like code in parentheses or an API marker, and unknown is never taken from a screen.
limit_from_window
Codex reports a spent account window as a bare JSON-RPC -32603 Internal error. When a fresh limit reading (heartbeat or a /status screen, at most a few minutes old) puts the 5h window at ~100%, such an otherwise unknown error is the limit.