Retry attributable xAI capacity protocol mismatches - #881
Merged
Conversation
TheGreatAxios
commented
Sep 11, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Request changes
xAI capacity protocol_mismatch remaps to retryable, but the exact “Service temporarily unavailable” path inspects the wrong field for real ProtocolMismatchError shapes.
Findings
src/inference-gateway-error.ts:257-263— exact match useserror.messageonly. intx puts parser detail onmessageand the server body onraw. SSE malformed-JSON / schema-fail withraw: "Service temporarily unavailable"still aborts. Substring"high demand"works because it searches combined text.- Remapped copy uses
GATEWAY_OVERLOAD_USER_MESSAGE(“retrying…”), which also surfaces after abort. - Substring path has no quota-marker veto, so mixed capacity+quota copy remaps.
Notes
GitHub blocks request-changes on own PRs, so this is a comment with that verdict.
TheGreatAxios
commented
Sep 11, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Critic · Request changes
Provider-gated remap and 3-attempt 500/1000ms bound are the right layer. Quota / unknown / OpenCode Go stay terminal.
Findings
textSuggestsXaiCapacityexact phrase is message-only; tests set the phrase asmessage, whichparseResponsedoes not produce.- Comment at
:241-245claims JSON-raw support; implementation does not searchrawfor the exact phrase.
TheGreatAxios
force-pushed
the
cl-7646-xai-capacity-retry
branch
3 times, most recently
from
September 11, 2026 03:14
dd0c718 to
467a083
Compare
xAI and Grok sometimes surface capacity or overload as protocol_mismatch instead of a retryable status. Remap those attributable phrases to retryable while leaving quota exhaustion, unknown providers, and OpenCode Go unchanged.
TheGreatAxios
force-pushed
the
cl-7646-xai-capacity-retry
branch
from
September 11, 2026 03:16
467a083 to
b1c3b7d
Compare
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
protocol_mismatchremaps to retryableVerification
bun run lint,bun run typecheck, andbun run buildpassbun run checkblocked by 4 pre-existing failures that reproduce on cleanorigin/main(unrelated to this branch):createOptimizedContextStore load > the next write heals a torn base tail so reload is stablecreateOptimizedContextStore unpublished rewrite > git commit failure after rewrite lands keeps load on HEADassembleChatAgent > omits evidence archive when no holder is providedassembleChatAgent > getWorkdir and getCompactor run at buildAgent time, not assemble timeFixes CL-7646