Repository navigation
fix(providers): xai-oauth chat→responses translation + breaker import (#10165) - #10170
Merged
diegosouzapw merged 1 commit intoAug 13, 2026
Conversation
cheaper-inference#10165) - Import isProviderBreakerFailureStatus in chat.ts (ReferenceError on cooldown path) - Tag xai-oauth/grok-4.5 with targetFormat openai-responses - XaiExecutor converts messages/max_tokens/response_format before /v1/responses - normalizeOpenAIResponsesRequest safety net for chat-shaped bodies Fixes cheaper-inference#10165
diegosouzapw
merged commit Aug 13, 2026
d085a0e
into
cheaper-inference:release/v3.8.50
3 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
cheaper-inference#10165) (cheaper-inference#10170) - Import isProviderBreakerFailureStatus in chat.ts (ReferenceError on cooldown path) - Tag xai-oauth/grok-4.5 with targetFormat openai-responses - XaiExecutor converts messages/max_tokens/response_format before /v1/responses - normalizeOpenAIResponsesRequest safety net for chat-shaped bodies Fixes cheaper-inference#10165 Co-authored-by: nordz0r <nordz0r@users.noreply.github.com>
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
Fixes #10165.
On
next-web/ 3.8.50,POST /v1/chat/completionsforxai-oauth/grok-4.5could hit xAI native/v1/responseswith a chat-shaped body:messageswithoutinput→ upstream 422 missing fieldinputmax_tokensnot mapped → 400 use max_output_tokensresponse_formatnot mapped → 400 use text.formatAccounts then entered cooldown and were logged as "rate limited" despite healthy OAuth. Control:
POST /v1/responseswithinputalready worked.Also fixes a runtime
ReferenceError: isProviderBreakerFailureStatus is not definedon the all-accounts-cooldown path (used but not imported inchat.ts).Changes
isProviderBreakerFailureStatusinsrc/sse/handlers/chat.tsxai-oauthmodelgrok-4.5withtargetFormat: "openai-responses"XaiExecutor.transformRequest: convert chat fields when routing to Responses (uses existingchatRequestToXaiResponses)normalizeOpenAIResponsesRequest: safety net for chat-shaped bodies that reach Responses normalizationtests/unit/executor-xai-chat-to-responses-10165.test.tsTest plan
POST /v1/chat/completions{ model: "xai-oauth/grok-4.5", messages: [...], max_tokens: 16 }→ 200stream: trueresponse_formatPOST /v1/responseswithinputstill works (native passthrough)ReferenceError: isProviderBreakerFailureStatuswhen all xai accounts are in cooldownNotes
Operational workaround while waiting for this: pin
main-web(3.8.49) where chat→Grok still works.