fix(openai-shim): strip store when baseUrl points at Mistral#1047
fix(openai-shim): strip store when baseUrl points at Mistral#10470xfandom wants to merge 1 commit into
store when baseUrl points at Mistral#1047Conversation
techbrewboss
left a comment
There was a problem hiding this comment.
Reviewed the Mistral host compatibility change and targeted regression test. The new predicate is narrowly used to strip only store, matching the existing Gemini/Cerebras handling for strict OpenAI-compatible hosts.
Verification: bun test src/services/api/openaiShim.test.ts passes, 92 tests / 0 failures.
|
hello @0xfandom this is good to merge, kindly rebase to main and fix conflicts |
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Targeted review of current head 23d5a7e.
Verdict: Needs changes
The actual Mistral store stripping change is small and looks reasonable from the diff: it mirrors the existing Gemini/Cerebras host checks and adds a focused regression test for api.mistral.ai.
Current blocker:
- GitHub reports this branch as
DIRTY/ conflicting withmain, so it cannot be merged or reliably final-approved as-is. Please rebase/merge latestmainand resolve the conflicts, then the focused test should be rerun against the rebased branch.
No additional code-level blocker from me beyond the merge conflict state.
gnanam1990
left a comment
There was a problem hiding this comment.
The Mistral store strip mirrors the existing Gemini/Cerebras pattern cleanly and is already approved by kevincodex1 and techbrewboss. Vasanthdev2004's CONFLICTING flag is still accurate — confirming a rebase is needed before merge.
Findings:
git merge origin/mainfrom PR head produces real conflicts insrc/services/api/openaiShim.tsandsrc/services/api/openaiShim.test.ts. PR #1048 (stripstorefor vLLM/custom local providers) landed on main and edits the sameshouldStripResponsesStorehelper and adjacent test cases. Please rebase, resolve sohasMistralApiHostparticipates in the same OR chain as the new local-provider checks, and rerun the focused test.
Non-blocking:
- Implementation itself is unchanged in value — only conflict resolution should be needed.
- After rebase,
bun test src/services/api/openaiShim.test.tsshould still report all cases passing.
Verified locally: gh pr checkout 1047, git fetch origin main, git merge --no-commit --no-ff origin/main → CONFLICT in both files; git merge --abort clean.
|
hi bro @0xfandom this is good to merge kindly please rebase and fix conflicts |
23d5a7e to
4255ad1
Compare
|
Rebased onto latest
|
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Targeted re-review of current head 4255ad1b, focused on the post-rebase Mistral store stripping fix.
Verdict: Approve-ready
What I checked:
- The Mistral detection uses parsed URL host matching (
api.mistral.ai/*.mistral.ai), so it avoids substring-based URL mistakes. - The change only joins the existing OpenAI-compatible provider compatibility gate that already strips unsupported
storefor Gemini/Cerebras/local providers. - The regression test verifies
storeis omitted forhttps://api.mistral.ai/v1. - CI is green on the current head.
Local validation:
bun test src/services/api/openaiShim.test.ts-> 93/93 passinggit diff --check main..HEAD-> clean
I do not see a remaining blocker on the current head.
Mistral's chat-completions endpoint rejects requests with a `store` field — `422 body.store: Extra inputs are not permitted`. The shim already strips `store` for Gemini and Cerebras hosts via `hasGeminiApiHost` / `hasCerebrasApiHost`; add the symmetric host check for Mistral so users hitting `api.mistral.ai` directly (without `CLAUDE_CODE_USE_MISTRAL=1` to engage the gateway profile) don't hit the same wall. Closes Gitlawb#739.
4255ad1 to
9591318
Compare
|
Rebased onto latest
Ready for merge. @kevincodex1 |
Summary
Mistral's chat-completions endpoint rejects requests with a
storefield —422 body.store: Extra inputs are not permitted(see #739). The shim already stripsstorefor Gemini and Cerebras hosts viahasGeminiApiHost/hasCerebrasApiHost(PRs #959, #1040). Add the symmetric host check for Mistral so users hittingapi.mistral.aidirectly — withoutCLAUDE_CODE_USE_MISTRAL=1to engage the gateway profile — don't hit the same wall.Impact
OPENAI_BASE_URL=https://api.mistral.ai/v1(or Custom-provider preset pointing there) no longer 422s on first request.storewhen baseUrl points at Cerebras (#1023) #1040; newhasMistralApiHost(baseUrl)predicate, single OR added toshouldStripResponsesStore.Testing
Mistral: strips unsupported store on chat_completions (#739)mirrors the Cerebras/Gemini cases, verifies request body has nostorekey.bun test src/services/api/openaiShim.test.ts— 92 pass / 0 fail.bun run build— bundle clean.bun run smoke— 0.9.2 OK.Notes
store-only, mirroring the merged Cerebras fix. Mistral also rejectsmax_completion_tokensfor some models; users wanting full Mistral profile (includingmax_tokensmapping, devstral defaults) should setCLAUDE_CODE_USE_MISTRAL=1to engage the gateway descriptor atsrc/integrations/gateways/mistral.ts.