Skip to content

AnthropicClient: don't send OpenAI-only parallel_tool_calls (fixes 400 on Claude OAuth provider) - #18

Open
tomatantan wants to merge 1 commit into
EthereumPhone:mainfrom
tomatantan:fix/anthropic-parallel-tool-calls
Open

AnthropicClient: don't send OpenAI-only parallel_tool_calls (fixes 400 on Claude OAuth provider)#18
tomatantan wants to merge 1 commit into
EthereumPhone:mainfrom
tomatantan:fix/anthropic-parallel-tool-calls

Conversation

@tomatantan

Copy link
Copy Markdown

Fixes #17.

Problem: with AI PROVIDER = Claude (OAuth), every request fails with HTTP 400 parallel_tool_calls: Extra inputs are not permitted. AnthropicClient emits parallel_tool_calls whenever tools are present; that field is OpenAI Chat Completions only, and the Anthropic Messages API rejects unknown top-level fields. The default budget preset stock_balanced sets parallelToolCalls = true, so the field is always sent (build 61 also has no Budget Mode UI to work around it).

Fix: never emit parallel_tool_calls to Anthropic. Parallel tool use is Anthropic's default; when a preset asks to disable it, express that as tool_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

… 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}.
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.

Claude (OAuth) provider: every request fails with 400 "parallel_tool_calls: Extra inputs are not permitted" (AnthropicClient sends an OpenAI-only field)

1 participant