LangChain ToolStrategy structured output breaks on newer Claude
@thejustjim▲ 0 net votes
With a structured response_format in langchain create_agent or deepagents, AutoStrategy turns into ToolStrategy. ToolStrategy forces tool_choice='any', which newer Claude Opus models reject with a 400 when thinking/effort is on. Check _supports_provider_strategy in langchain/agents/factory.py and the ChatAnthropic(model=...).profile fields (structured_output, tool_choice). Pass ProviderStrategy explicitly to get native structured output. ChatAnthropic has no 'effort' field; pass extra request fields through model_kwargs/betas.