fix(ai-gateway): exclude DeepSeek models from Vercel routing - #2821
Closed
lambertjosh wants to merge 1 commit into
Closed
fix(ai-gateway): exclude DeepSeek models from Vercel routing#2821lambertjosh wants to merge 1 commit into
lambertjosh wants to merge 1 commit into
Conversation
DeepSeek in thinking mode requires assistant messages to round-trip `reasoning_content` back to the API. OpenRouter translates from `providerOptions.openrouter.reasoning_details` automatically; Vercel AI Gateway routes directly to DeepSeek without that translation, causing 400 errors on multi-turn reasoning conversations. Matches the existing exclusion pattern used for other incompatible models (OpenAI, Kimi, etc.) in earlier revisions of the gateway.
Contributor
Author
|
Not needed, needed to bump kilo gw version. |
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-2026-03-05 · 523,532 tokens |
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
DeepSeek in thinking mode requires assistant messages to round-trip `reasoning_content` back to the API. OpenRouter translates from `providerOptions.openrouter.reasoning_details` automatically; Vercel AI Gateway routes directly to DeepSeek without that translation, producing 400s on multi-turn reasoning conversations.
This adds a DeepSeek exclusion to `shouldRouteToVercel` so the default OpenRouter path is always used. Matches the existing exclusion pattern used for other incompatible models in earlier revisions of the gateway.
Reported error
```
[DeepSeek] The `reasoning_content` in the thinking mode must be passed back to the API.
providerMetadata.gateway.routing.resolvedProvider = "deepseek"
```
Related
Companion to Kilo-Org/kilocode#9526, which cherry-picks the upstream client-side fix for the OpenRouter path. That PR covers direct OpenRouter and `@kilocode/kilo-gateway` → OpenRouter. This PR covers the remaining `@kilocode/kilo-gateway` → Vercel → DeepSeek path.