Skip to content

Conversation

@seefs001
Copy link
Collaborator

@seefs001 seefs001 commented Jan 28, 2026

disable_parallel_tool_use should be removed for tool_choice=none
fix #2763

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of parallel tool configuration when tool selection is disabled to prevent schema validation conflicts.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

The change adds conditional logic to prevent setting DisableParallelToolUse when tool_choice.Type is "none", resolving an Anthropic API validation error that rejects extra fields in the none variant.

Changes

Cohort / File(s) Summary
Bug Fix
relay/channel/claude/relay-claude.go
Conditionalized DisableParallelToolUse field assignment in mapToolChoice to only apply when tool_choice.Type is not "none", preventing schema validation errors from Anthropic API

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A little field caused quite a stir,
When "none" met "parallel"—oh, what a blur!
But now we check before we set,
And Anthropic's happy—no more upset!
*~ A hoppy fix for a tiny bug* 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main fix: removing disable_parallel_tool_use when tool_choice is 'none', which matches the code change and solves issue #2763.
Linked Issues check ✅ Passed The code change directly addresses issue #2763 by conditionalizing the DisableParallelToolUse field to only be set when tool_choice.Type is not 'none', preventing the API error when tool_choice is 'none'.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the specific issue: conditionalization of DisableParallelToolUse field in mapToolChoice function, with no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion Calcium-Ion merged commit 8d5ac47 into QuantumNous:main Jan 29, 2026
1 check passed
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.

tool_choice=none + parallel_tool_calls=false = anthropic api error

2 participants