Repository navigation
fix(provider): fall back to auto tool choice when forced is rejected - #261
Draft
johnandersen777 wants to merge 1 commit into
Draft
johnandersen777 wants to merge 1 commit into
johnandersen777 wants to merge 1 commit into
Conversation
johnandersen777
force-pushed
the
fix/tool-canary-auto-fallback
branch
2 times, most recently
from
November 30, 2026 08:41
a3950de to
844980e
Compare
Some attached servers reject a forced tool_choice while supporting automatic calls. The tool canary retries once with tool_choice auto and a neutral system prompt, and attached jobs rewrite forced/required choices to auto (none drops tools) when only that probe passed. Co-Authored-By: Claude Code <noreply@anthropic.com>
johnandersen777
force-pushed
the
fix/tool-canary-auto-fallback
branch
from
November 30, 2026 08:49
844980e to
28cfe4a
Compare
This branch has not been deployed
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.
Problem
Some OpenAI-compatible servers reject a forced
tool_choicewhile supporting automatic tool calls. The tool canary only tried forced, so such servers were registered without tool support. Even after an auto pass, job requests forwarded forced/required choices and failed upstream.Fix
tool_choice: "auto"and a neutral system prompt. Advertise only when either probe returns a validreport_statuscall.required/named forced choices toauto; omitted stays omitted;noneis sent withouttoolsortool_choice.Verification
cargo test --lib— 257 passedcargo clippy --locked --all-targets --all-features -- -D warnings— cleancargo fmt --check— cleaninkling-2-mini,report_status{"status":"ok"}for omitted,auto,required, and forced function choice;nonereturns no toolspi(direct deno invocation, providercocore) ran a bash tool call through cocoreLimitations
requiredand named forced choices toauto; callers may receive a different tool call or none.Merge note
With #259, resolve the shared canary helper to
"tool_choice": tool_choiceand"max_tokens": 2048.Draft PR (no issue link).
🤖 Generated with Claude Code