Stop advertising `CodeExecutionTool` on the legacy `AsyncAnthropicBedrock` client
- Closes #11513
AnthropicModel.profile advertised CodeExecutionTool on the legacy Bedrock InvokeModel client (AsyncAnthropicBedrock), but Bedrock rejects every code execution tool version. Re-probed live on eu.anthropic.claude-sonnet-4-5-20250929-v1:0:
400 tools.0: Input tag 'code_execution_20250825' found using 'type' does not match any of the expected tags: 'bash_20250124', 'custom', 'text_editor_20250124', 'text_editor_20250429', 'text_editor_20250728'
(code_execution_20260120 fails the same way.) This adds _CODE_EXECUTION_UNSUPPORTED_CLIENTS = (AsyncAnthropicBedrock,) next to the web-tool and advisor tuples, so NativeTool(CodeExecutionTool()) now raises the usual unsupported-native-tool UserError before the request (or is dropped when optional=True / a local fallback exists), and notes it in the docs/native-tools.md support table.
Other clients: AsyncAnthropicBedrockMantle (Claude Platform on AWS) and AsyncAnthropicFoundry are listed as supported in Anthropic's code execution docs and are unchanged. Vertex AI is not listed there, but I couldn't probe it (a free-tier GCP project has zero, non-adjustable Claude quota), so I left it advertised rather than narrow on an unverified docs omission. Happy to add AsyncAnthropicVertex to the tuple if the docs are enough.
What changes for existing users: nothing for code that worked; Bedrock + CodeExecutionTool fails earlier with a UserError instead of a provider 400.
Test plan
tests/models/test_anthropic.py::test_anthropic_code_execution_tool_client_gatingchecks the profile for the direct API, Bedrock and Mantle, and theUserErroron a Bedrock run. Fails onmain, passes here.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
š¤ Generated with Claude Code