AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

ChatAnthropic Sends Unsupported Tool Choice And Disabled Thinking For Claude Opus 5.5

ChatAnthropic allows forced tool_choice and thinking={"type":"disabled"} to reach the Anthropic API for claude-opus-5-5, causing 400 invalid-request errors. bind_tools(), call-time kwargs, model_kwargs, and create_agent() with structured-output tools are affected.

highConfidence 90%Langchain-AnthropicChat ModelsChainsAffected V1.7.3

Origin Analysis

_supports_forced_tool_choice() is not consulted in bind_tools() or final _get_request_payload(), so forced tool_choice is sent to Opus 5.5. In addition, Opus 5.5-specific thinking validation is missing; only Opus 5 xhigh/max disabled-thinking is rejected.
1. Instantiate ChatAnthropic(model="claude-opus-5-5"). 2. Call bind_tools([GetWeather], tool_choice="any") and inspect _get_request_payload(...)["tool_choice"]; it returns {"type":"any"} instead of auto. 3. Instantiate ChatAnthropic(model="claude-opus-5-5", thinking={"type":"disabled"}) and inspect _get_request_payload("Hello")["thinking"]; it returns {"type":"disabled"} with no ValueError. 4. Send either payload to Anthropic API and observe 400 invalid-request.

Fixing Code Block

Edge Case Audit

Downgrading forced tool_choice to auto changes behavior: the model may not invoke the tool, so callers must handle missing tool calls. The warning is the only signal; upgrade path should ensure downstream logic tolerates auto choice. The monkey patch modifies _get_request_payload; if future versions add new parameters they must be preserved. Rollback: revert this monkey patch or remove forced tool_choice/avoid disabled thinking for Opus 5.5.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state