Skip to content

fix(sse): stop sending type:"custom" Claude tools to DeepSeek - #16281

Merged
diegosouzapw merged 2 commits into
release/v3.8.52from
fix/port-issue-3905-deepseek-claude-custom-tool-type
Oct 13, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.52from
fix/port-issue-3905-deepseek-claude-custom-tool-type

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Summary

Root cause

normalizeClaudeToolsForDispatch backfilled type: "custom" for every provider except agentrouter. DeepSeek's Anthropic-compatible endpoint (api.deepseek.com/anthropic) rejects that variant with HTTP 400 unknown variant 'custom', so every tool-using request on a Claude-format DeepSeek connection failed.

Fix

The single provider === "agentrouter" check becomes a CLAUDE_CUSTOM_TOOL_TYPE_REJECTING_PROVIDERS set (agentrouter, deepseek). Providers in the set get type: "custom" stripped (versioned types such as web_search_20250305 are kept); everyone else keeps the default.

Attribution

Thanks to @0xH3li0 and @kabeza for the original reports.

Test plan

  • New regression test tests/unit/deepseek-claude-custom-tool-type-3905.test.ts — fails on the base (2/4), passes after the fix
  • Sibling suites agentrouter-custom-tool-type, claude-tool-type-default-2195 — 18/18
  • eslint (with suppressions) + prettier on touched files, npm run typecheck:core

⚠️ base-red inherited: #15306

…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)
@github-actions

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw merged commit 788cd78 into release/v3.8.52 Oct 13, 2026
35 of 56 checks passed
@diegosouzapw
diegosouzapw deleted the fix/port-issue-3905-deepseek-claude-custom-tool-type branch October 18, 2026 23:50
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