Skip to content

fix(auto_routing): don't require tools capability when tool_choice is set without tools payload - #106

Open
rdrip wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
rdrip:fix/auto-routing-tool-choice-without-tools
Open

rdrip wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
rdrip:fix/auto-routing-tool-choice-without-tools

Conversation

@rdrip

@rdrip rdrip commented Sep 14, 2026

Copy link
Copy Markdown

Orca-Code-Review — push 1

Severity Count
P0 0
P1 0
P2 0
P3 0

✅ no blocking findings

required_capabilities adds "tools" to the needed set whenever tool_choice is a non-empty string (like "auto"), even when the request has no tools defined. Per the OpenAI spec, a string tool_choice without a tools payload is a no-op.

This caused auto routing to filter out non-tool-capable models for any request carrying tool_choice="auto" (some SDKs send this on every request by default).

The fix: string tool_choice only requires tools when a tools payload is actually present. Dict tool_choice still requires tools unconditionally.

8 new tests cover the tool_choice x tools-payload interaction matrix. Existing 47 auto_routing tests still pass.

… set without tools payload

required_capabilities adds "tools" to the needed set whenever
tool_choice is a non-empty string (like "auto"), even when the
request has no tools defined. Per the OpenAI spec, a string
tool_choice without a tools payload is a no-op — the provider
silently ignores it.

This caused auto routing to filter out non-tool-capable models for
any request carrying tool_choice="auto" (some SDKs send this on
every request by default), unnecessarily narrowing the candidate set.

Now string tool_choice only requires tools when a tools payload is
actually present. Dict tool_choice (which names a specific function)
still requires tools unconditionally.

@orcacode-review orcacode-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳 OrcaCode Review

No findings — nothing to flag in this PR. Great work!

OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 453 calls · 32.3M tokens · 99% cached

❤️ Share · Install OrcaCode Review

Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.

Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter

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