Repository navigation
fix(sse): stop sending type:"custom" Claude tools to DeepSeek - #16281
Merged
diegosouzapw merged 2 commits intoOct 13, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
…rom 9router#3905) normalizeClaudeToolsForDispatch() backfilled type:"custom" (the MiniMax #2195 default) for every provider except agentrouter. DeepSeek's Anthropic-compatible endpoint rejects that variant with HTTP 400 "tools[0]: unknown variant `custom`", so every Claude-format DeepSeek request carrying tools failed. DeepSeek now joins agentrouter in a set of providers that get the discriminator stripped. Reported-by: 0xH3li0 (decolua/9router#3905) Reported-by: kabeza (decolua/9router#3952)
Contributor
CI Coverage Report
Coverage artifact was not available for this run. |
diegosouzapw
deleted the
fix/port-issue-3905-deepseek-claude-custom-tool-type
branch
October 18, 2026 23:50
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
targetFormat=claude) no longer receivetype: "custom"on tool definitions.Root cause
normalizeClaudeToolsForDispatchbackfilledtype: "custom"for every provider exceptagentrouter. DeepSeek's Anthropic-compatible endpoint (api.deepseek.com/anthropic) rejects that variant with HTTP 400unknown variant 'custom', so every tool-using request on a Claude-format DeepSeek connection failed.Fix
The single
provider === "agentrouter"check becomes aCLAUDE_CUSTOM_TOOL_TYPE_REJECTING_PROVIDERSset (agentrouter,deepseek). Providers in the set gettype: "custom"stripped (versioned types such asweb_search_20250305are kept); everyone else keeps the default.Attribution
Thanks to @0xH3li0 and @kabeza for the original reports.
Test plan
tests/unit/deepseek-claude-custom-tool-type-3905.test.ts— fails on the base (2/4), passes after the fixagentrouter-custom-tool-type,claude-tool-type-default-2195— 18/18npm run typecheck:core