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 toMAX_ATTEMPTS(PTY: types “continue”; ACP: the last prompt again).limit: a 5h / 7d window is spent. No retry; the existinglimitsession 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. Onlyfatal,unknownandretryablewith attempts spent escalate (aprovider_errorsession signal to core → one HQ-ERROR letter, the run’s card to blocked). Retries themselves go to the node log only (targetprovider_retry). Error text is clipped and never carries prompt or screen content beyond the matching line.
Structs§
Enums§
Constants§
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, andunknownis never taken from a screen.