Repository navigation
fix(providers): route unknown grok-cli ids through the Responses wire format - #14583
Merged
diegosouzapw merged 2 commits intoSep 24, 2026
Conversation
GrokCliExecutor always POSTs to Grok Build's /v1/responses, and live
discovery only keeps `responses` backends, but getModelTargetFormat()
returned null for any id missing from the static seed. chatCore then fell
back to the provider format ("openai") and sent a chat-completions body,
which Grok Build rejects with HTTP 400. That broke grok-4.7 on release day
for every connection that had not run a model sync yet.
Scoped to the grok-cli alias; seeded ids keep their explicit tags and
xai / xai-oauth unknown ids are unchanged.
Collaborator
|
Nice catch — the live 400 you observed on release/v3.8.51 (with the upstream echoing the |
diegosouzapw
merged commit Sep 24, 2026
f2293e9
into
cheaper-inference:release/v3.8.51
3 checks passed
deptrai
pushed a commit
to deptrai/OmniRoute
that referenced
this pull request
Sep 28, 2026
… format (cheaper-inference#14583) Validated in the round-3 combined board (release/v3.8.51 @ e3b152badd + 59 PRs, gates on the 192.168.0.113 box): typecheck/open-sse/dashboard typecheck, complexity, cognitive, changelog integrity, route-validation, docs-counts, cycles, changed node:test files and vitest green except the inherited base-reds tracked in cheaper-inference#14496/cheaper-inference#14547 and file-size ratchet drift (rebaselined in a follow-up). Thanks @VIPKaiser!
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.
Problem
grok-cli/<id>for any model id that is not in the static grok-cli seed (e.g.grok-4.7on its release day,grok-4.7-build-fast) gets HTTP 400 from Grok Build until the connection has run a model sync.GrokCliExecutoralways POSTs to Grok Build's/v1/responses, and live discovery only keepsresponsesbackends, so every grok-cli model is a Responses model.getModelTargetFormat("gc", id)returnsnullfor ids missing from the seed, soresolveChatCoreTargetFormatfalls back to the provider format ("openai") and the translator builds a chat-completions body (messages/max_tokens) that is posted to/v1/responses.targetFormat: "openai-responses"explicitly.Observed live on release/v3.8.51:
grok-cli/grok-4.7returned 400 on both pooled accounts (the upstream still echoedx-grok-context-window: 500000, so the model itself was recognised) whilegrok-cli/grok-4.6succeeded. After a sync, the synced entry'sapiFormat: "responses"masks the bug, but connections that never synced (existing ones; new ones before the first sync) keep hitting it.Fix
One fallback in
getModelTargetFormat, next to the existingopenai*-proheuristic (#5842): for thegcalias, return"openai-responses"when the seed has no explicit tag. The registry entry'sformat: "openai"is left alone on purpose (its comment keeps the generic translate-path contract stable).xai/xai-oauthunknown ids still returnnull(their executors choose/chat/completionsvs/responsesthemselves).Relationship to open PRs
Complementary, no file overlap:
grok-4.7in grok-cli (with reasoning tiers). This PR makes the next unseeded id work without waiting for a seed bump.Tests
tests/unit/grok-cli-passthrough-responses-format.test.ts: alias and provider-id lookups for unknown ids, seeded ids unchanged,resolveChatCoreTargetFormatend-to-end for an unsynced id, and a negative check that xai / xai-oauth are unaffected.grok-cli-*,*target-format*,xai*,chatcore-upstream-bodysuites: 287 + 38 pass locally. Typecheck and lint clean for the touched files.A changelog fragment will follow once the PR number is assigned.