Skip to content

fix(models): ruled retryability for synthetic stream markers; ChatGPT OAuth stream honesty - #56

Merged
rezaho merged 2 commits into
mainfrom
stream-fault-policy-rulings
Aug 20, 2026
Merged

fix(models): ruled retryability for synthetic stream markers; ChatGPT OAuth stream honesty#56
rezaho merged 2 commits into
mainfrom
stream-fault-policy-rulings

Conversation

@rezaho

@rezaho rezaho commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Two policy flips ruled after the stream-fault classification fix (#55), plus the OAuth twin's variant of the same dishonesty class.

Retryability rulings. The adapters' synthetic max_retries and incomplete_stream markers were deliberately pinned UNKNOWN/non-retryable in #55 pending a policy decision. Ruled: both flip to retryable. They are our own markers, not provider vocabulary, so they now classify in one provider-independent arm above the provider dispatch — exhausting the adapter's quick in-call retry budget is SERVICE_UNAVAILABLE (the provider was already saying retry; recovery hands to the caller's slower ladder), and a truncated stream is NETWORK_ERROR (a transport fault, not a provider verdict). Code-less faults unify: a bare response.failed, a message-only flat error event, and the bare-event fallback all take the retryable provider-side disposition — request-shaped faults always carry codes. openai-oauth joins the openai/azure dispatch (same Responses wire contract).

OAuth stream honesty. The ChatGPT-backend adapter packaged an in-stream error event as a plain dict that flowed into harmonization and surfaced as an EMPTY SUCCESSFUL response — the provider's verdict never reached classification. response.failed was ignored outright; a stream that died before its terminal event returned partial output as a completed answer. Both readers now raise the real provider error through the shared stream_error_payload seam, treat response.incomplete as the usable terminal it is, and refuse to present a truncated stream as success.

Tests: 7 new oauth stream-honesty tests (MockTransport, both sync and async readers); the harmonize matrix flips its pinned rows and adds rows for provider-independence of the marker arm, code-less unification, and the openai-oauth family membership. Full suite: 1670 passed; the 5 remaining failures are the known Windows-box environment set (readline collection, cwd-sensitive path test, live-key smoke), reproduced identically on main.

rezaho added 2 commits August 20, 2026 13:33
…y above the provider dispatch

max_retries and incomplete_stream are the adapters' own synthetic markers, not provider
vocabulary, so they now classify in one provider-independent arm: exhausting the quick
in-call retry budget is SERVICE_UNAVAILABLE/retryable (the provider was already saying
retry), and a truncated stream is NETWORK_ERROR/retryable (a transport fault, not a
verdict). Code-less faults unify: a bare response.failed, a message-only flat error, and
the bare-event fallback are all the provider aborting without naming a request-shaped
cause — request-shaped faults always carry codes — so all take the retryable
provider-side disposition. The ChatGPT OAuth backend joins the openai/azure dispatch
(same Responses wire contract).
An in-stream error event was packaged as a plain dict that flowed into harmonization
and surfaced as an EMPTY SUCCESSFUL response — the provider's verdict (and its code)
never reached classification. response.failed was ignored outright, and a stream that
died before its terminal event returned partial output as a completed answer. Both
readers now raise the REAL provider error through the shared stream_error_payload seam
(flat grammar read correctly, partial length annotated, text never leaked), treat
response.incomplete as the usable terminal it is, and refuse to present a truncated
stream as success (incomplete_stream marker).
@rezaho
rezaho merged commit 33121cc into main Aug 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant