Skip to content

fix(ai-gateway): exclude DeepSeek models from Vercel routing - #2821

Closed
lambertjosh wants to merge 1 commit into
mainfrom
fix/exclude-deepseek-vercel-routing
Closed

fix(ai-gateway): exclude DeepSeek models from Vercel routing#2821
lambertjosh wants to merge 1 commit into
mainfrom
fix/exclude-deepseek-vercel-routing

Conversation

@lambertjosh

Copy link
Copy Markdown
Contributor

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.

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.
@lambertjosh

Copy link
Copy Markdown
Contributor Author

Not needed, needed to bump kilo gw version.

@kilo-code-bot

kilo-code-bot Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/lib/ai-gateway/providers/vercel/index.ts
  • apps/web/src/lib/ai-gateway/providers/vercel/index.test.ts

Reviewed by gpt-5.4-2026-03-05 · 523,532 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant