AnthropicClient: don't send OpenAI-only parallel_tool_calls (fixes 400 on Claude OAuth provider) - #18
Open
tomatantan wants to merge 1 commit into
Conversation
… Anthropic); map disable to tool_choice.disable_parallel_tool_use Fixes EthereumPhone#17. The Anthropic Messages API rejects unknown top-level fields; the default stock_balanced preset sets parallelToolCalls=true so every Claude (OAuth) request failed. Parallel tool use is Anthropic's default; only the disable case is expressed, via tool_choice {type: auto, disable_parallel_tool_use: true}.
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.
Fixes #17.
Problem: with AI PROVIDER = Claude (OAuth), every request fails with HTTP 400
parallel_tool_calls: Extra inputs are not permitted.AnthropicClientemitsparallel_tool_callswhenever tools are present; that field is OpenAI Chat Completions only, and the Anthropic Messages API rejects unknown top-level fields. The default budget presetstock_balancedsetsparallelToolCalls = true, so the field is always sent (build 61 also has no Budget Mode UI to work around it).Fix: never emit
parallel_tool_callsto Anthropic. Parallel tool use is Anthropic's default; when a preset asks to disable it, express that astool_choice: {type: auto, disable_parallel_tool_use: true}(documented Anthropic field).Evidence: dGEN1 / ethOS V04.20260327 / AndyClaw 61 logcat — see #17.
Not compiled locally (no AndyClaw build env here); the change is confined to the JSON builder and uses the same kotlinx.serialization helpers already in the file.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LgJqYbycEnJ22f57BzU1AH