Repository navigation
refactor(provider): share error-body reading, adapter mechanics, protocol sets - #1435
Merged
TheGreatAxios merged 1 commit intoOct 15, 2026
Conversation
…ocol sets Four provider-side twins collapse: the usage-limit parser and the gateway now share one error-body reader/walker (Codex exact-code match and xAI substring markers stay apart); seven adapters share JSON-rewrite and extra-header mechanics while per-adapter semantics stay local (the decorators bail to an unchanged request when nothing applies); a single Anthropic-protocol identity set + canonical segment replaces two sets + two canonicalizers; and one /models endpoint parser replaces the ollama/bounded-catalog pair. A retryFromBody hook lifts Codex resets_in_seconds onto retryAfterMs but only for Codex.
Contributor
|
Superseded by the comment below. |
Contributor
|
Superseded by the comment below. |
Contributor
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
TheGreatAxios
changed the base branch from
cl-10665-auth-de-dupe-shared-callbackloginsessionstorelock-h
to
main
October 15, 2026 22:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
error-body.ts) serves both the structured Codex usage-limit parser and the gateway (exact-code vs substring matchers stay strictly separate; aretryFromBodyhook lifts Codexresets_in_secondsontoretryAfterMs— Codex-only by construction, non-Codex ignore pinned by test); shared adapter-decorator mechanics (withJsonBodyRewrite/withExtraHeaders/registry wrap) with bail-to-unchanged-request semantics while codex parallel_tool_calls, providerOptions merging, DeepSeek reasoning strip, Bifrost sentinel, session/cache-breakpoint headers stay in the adapters; one Anthropic-protocol identity set + canonical-segment helper replaces two sets + two canonicalizers (byte-equivalent union verified); one/modelsendpoint parser for the ollama/bounded-catalog pair with per-caller cap behavior preserved.buildRequestin openai-compatible/deepseek paths now passes through unrewritten to the wire (unreachable in practice — base adapters always emit JSON; lenient beats loud here, and the byte-identity + non-JSON passthrough pins cover it).Verification
bun run checkexit 0: 8967 pass / 0 fail across 584 files.src/provider417 pass / 0 fail;openai-responses+grok-responsesretry contracts 23 pass / 0 fail;src/inference-gateway-error74 pass / 0 fail; new tests pin body-wins retry, non-Codex body-reset ignorance, and both decorator bail paths.Fixes CL-10664