Stop sending a history container on Anthropic requests without code execution
This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.
- Closes #11761
Why we make these changes
After a run that used Anthropic code execution, a follow-up without code execution fails: AnthropicModel reuses the history container_id on every request, and the Claude API rejects it with 400 Container identifier can only be provided when using the code execution tool. The container is now sent only on requests with code execution. Split from #10489, which bundled this fix with its web tool changes.
User-visible behavior
pydantic_ai_slim/pydantic_ai/models/anthropic/__init__.py :: AnthropicModel._messages_create()
└─ pydantic_ai_slim/pydantic_ai/models/anthropic/__init__.py :: AnthropicModel._prepare_messages_create()
- └─ pydantic_ai_slim/pydantic_ai/models/anthropic/__init__.py :: AnthropicModel._get_container(messages, model_settings)
+ └─ pydantic_ai_slim/pydantic_ai/models/anthropic/__init__.py :: AnthropicModel._get_container(messages, model_settings, tools)
├─ anthropic_container set → sent as before
├─ anthropic_accepts_file_and_container_ids off → nothing, as before
+ ├─ no extra_body['tools'], no code execution in tools → None
├─ suspended response → its container id (pause_turn reconnect)
└─ history scan → last container id
A request has code execution when its tools include a code_execution_* tool, or a web tool code execution may call: a 20260209 version by default, or any version whose allowed_callers names a code execution caller. A web tool limited to ['direct'] doesn't count. The check is provisions_code_execution, which AnthropicModel's server_tool_use filter also uses. A request carrying extra_body['tools'] isn't read and keeps sending the container.
Verification
test_anthropic_container_from_history_not_sent_without_code_execution— recorded: code execution run, then a toolless follow-up that sends no container and succeeds.test_anthropic_history_container_without_code_execution_by_client— per client, completed and suspended history,20260209web search and web fetch,anthropic_web_tools_allowed_callersset to['direct']and to a code execution caller on the previous web search version,extra_body['tools'].test_anthropic_container_from_message_history_not_sent_for_function_tool,test_anthropic_pause_turn_reconnect_keeps_extra_body_code_execution_container.
What changes for existing users
A request without code execution on the Claude API no longer sends the history container, which only removes a 400.
PR decisions
2026-10-28 · split from #10489: PR 2 of 3, plan approved · iter -
- Decision: This PR is PR 2 of the #10489 split (approved by David): no history container on an Anthropic request without code execution, behind new profile key anthropic_rejects_container_without_code_execution (default True, off for Vertex, Bedrock Messages API and Foundry in _instance_profile_defaults); the gate sits above the pause_turn reconnect; 'a request that carries extra_body['tools'] keeps main's behavior' (container sent); provisions_code_execution in its type-only form since PR 1 (#10489) hasn't merged
- Why: Each change of #10489 lands with its own regression argument; this gate only changes requests the API answers with 400 'Container identifier can only be provided when using the code execution tool' (req_011CgRC4pgDK6YWqccY3ahYS, req_011CgRTNhQR9FdwLg78pKnU8)
- Source: https://github.com/pydantic/pydantic-ai/pull/10489 (David via manager relay, local-notes/dispatch-20261028T165542Z.md; plan local-notes/from-10489/fable-rethink/PLAN.md §2.0, §2.2, §5)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 1 of 3 at c1bb4bbab6ab5ee1ca7d0f6623f4ec87cabcced3 · iter -
- Decision: reserved; dispatched (light tier, Haiku)
- Why: tree afc67d24e6a7081f3cdaa7a170d2d7e62d6d0c62; full branch 7e3f4be6d..c1bb4bbab; policy base a70042d56; first review
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet); issue https://github.com/pydantic/pydantic-ai/issues/11761
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 1 of 3 at c1bb4bbab6ab5ee1ca7d0f6623f4ec87cabcced3 · iter -
- Decision: 5 findings: (1) name AsyncAnthropicGoogleCloud beside AsyncAnthropicAWS in the client comment (both serve the Claude API through AsyncAnthropic subclasses; settled client list unchanged), (2) docs and anthropic_container docstring: web tools count on models with dynamic filtering, not a user-picked version, (3) inline the single-use web tool type set, (5) rename the shadowing local in _pause_turn_segment — all do; (4) remove '# pragma: no cover' on the never-called function tool — skip; prefect gap closed
- Why: tree afc67d24e6a7081f3cdaa7a170d2d7e62d6d0c62; scope 7e3f4be6d..c1bb4bbab full branch; (4) net-negative: 26 agent tools in tests/models/test_anthropic.py use the same pragma on a body the test never runs, and calling it adds mock machinery the request-shape claim doesn't need; prefect: the same 13 failures on merge base 7e3f4be6d (local blockbuster os.mkdir), not this change
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 2 of 3 at 2cbcad339b016d041fe987410c5adbca1056525f · iter -
- Decision: reserved; dispatched (light tier, Haiku)
- Why: tree 0abeedeba4e4bd67aa954f4720218c4ecf395a67; scope c1bb4bbab..2cbcad339b016d041fe987410c5adbca1056525f (review 1 remediation) + full branch 7e3f4be6d..2cbcad339b016d041fe987410c5adbca1056525f as context; last reviewed c1bb4bbab (tree afc67d24e)
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 2 of 3 at 2cbcad339b016d041fe987410c5adbca1056525f · iter -
- Decision: Call-1 findings 2, 3, 5 verified fixed, dismissal of 4 upheld. 3 findings, all do (comment/docs only): (1) client comment says Claude Platform on AWS and on Google Cloud weren't probed and are treated as the Claude API (settled unverified list unchanged), (2) docs + anthropic_container docstring: web tools count where they're sent as the 20260209 versions (client narrowing included), (3) 'Claude Platform on Google Cloud' so it isn't confused with Vertex
- Why: tree 0abeedeba4e4bd67aa954f4720218c4ecf395a67; scope c1bb4bbab..2cbcad339 + full branch as context; remediated in e1d3aa797dc16b7270411356d7dfc4555981153f
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 3 of 3 at e1d3aa797dc16b7270411356d7dfc4555981153f · iter -
- Decision: reserved; dispatched (light tier, Haiku)
- Why: tree 91a51949748bcfba118d6e2f1a5db521cc09261b; scope 2cbcad339..e1d3aa797dc16b7270411356d7dfc4555981153f (review 2 remediation, comment/docstring/docs only) + full branch as context; last reviewed 2cbcad339 (tree 0abeedeba)
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-28 · pre-push review 3 of 3 at e1d3aa797dc16b7270411356d7dfc4555981153f · iter -
- Decision: no findings (current); call-2 findings 1-3 verified fixed; review budget exhausted
- Why: tree 91a51949748bcfba118d6e2f1a5db521cc09261b; scope 2cbcad339..e1d3aa797 + full branch as context
- Source: https://github.com/pydantic/pydantic-ai/tree/anthropic-container-without-code-execution (no PR yet)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · additional review surface: pydanty:review-lite on e1d3aa797 · iter -
- Decision: David picked pydanty:review-lite as the second opinion; label applied on head e1d3aa797dc16b7270411356d7dfc4555981153f; no pushes or thread changes while pydanty:is-working is set; its review is triaged under the pushing-commits-to-the-repo gate
- Why: Merge bar already met (CI green, douwebot APPROVE); diff adds a public profile key and changes container sending; review-lite writes charters for this diff and only reports; live checks (a)-(c) stay owed until the Anthropic key has credit
- Source: https://github.com/pydantic/pydantic-ai/pull/11764 (David via manager relay, local-notes/dispatch-20261029T174910Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · pydanty review-lite run df_run_f48c6a6b1ee94270b192 triage at e1d3aa797 · iter -
- Decision: 3+5 (web_fetch_20260209 arm untested), 2 (_pause_turn_segment single use), optional 1 (container value) — do, test-only in 98fc7239b; 1 (inline provisions_code_execution) — skip; 4 (match 20260209-or-later web tool types) — skip; optional 2 (resolution matrix blind to _instance_profile_defaults) — skip
- Why: 1: PLAN §5 'if PR 2 lands first it carries the type-only form and PR 1 adds the callers clause'; #10489 head 1cb7f1db2 calls it from 2 sites, PR 3 from a third; 4: provisions_code_execution reads only built tools and _map_web_search_tool/_map_web_fetch_tool emit only 20260209 (later versions only via extra_body, which keeps the container); a mapper bump fails api-web-search/api-web-fetch; opt 2: pre-existing matrix design, both flag sides pinned by api/mantle cases; mutation: dropping the web_fetch arm fails only [api-web-fetch]
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#issuecomment-6504203938
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · exempt delta e1d3aa797..98fc7239b (no review budget left) · iter -
- Decision: push 98fc7239bf0998add8d44e4f3adc895de4f1a10f without a pre-push review: exempt row 'Missing coverage, test-harness repairs' — test code only; chains from reviewed e1d3aa797 (tree 91a51949748bcfba118d6e2f1a5db521cc09261b), budget 3/3 used
- Why: git diff --stat e1d3aa797..98fc7239b: only tests/models/anthropic/test_code_execution_files.py; no cassette or snapshot change; established expectation unchanged (container sent for 20260209 web tools per PR body and docs); affected tests pass (26 container + 2 test_anthropic nodes)
- Source: https://github.com/pydantic/pydantic-ai/pull/11764
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · provisions_code_execution: two definitions across #11764 and #10489 · iter -
- Decision: #10489 at 278ecafe1 defines provisions_code_execution(tools: Sequence[BetaToolUnionParam]) with an allowed_callers clause and calls it from one site (AnthropicModel's implicit code_execution filter, models/anthropic/init.py); this PR defines the type-only form over Sequence[Mapping[str, object]] called from _get_container; whichever PR merges second reconciles them into one definition
- Why: Corrects the triage entry's '#10489 head 1cb7f1db2 calls it from 2 sites' (true at 1cb7f1db2, not at the current head 278ecafe1); sits beside #10489's known-limitation pointer to #11764 (anthropic-web-tools-allowed-callers worktree pr-decisions, entry 'PR 2 of the split is #11764; push 278ecafe1')
- Source: https://github.com/pydantic/pydantic-ai/pull/10489 (head 278ecafe16926d8c82bf20fdae999535945ebfe1; David via manager relay, local-notes/dispatch-20261029T185738Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
- Supersedes: pydanty review-lite run df_run_f48c6a6b1ee94270b192 triage at e1d3aa797 (finding 1 call-site count only)
2026-10-29 · douwebot re-applied at 98fc7239b; pydanty dismissal blocked · iter -
- Decision: Triage reply posted (issuecomment-6505813114); douwebot label applied on head 98fc7239bf0998add8d44e4f3adc895de4f1a10f; dismissal of pydanty review 5702926557 via dismiss-addressed-bot-review was denied by the Claude Code auto-mode classifier, not attempted another way — pending David
- Why: Merge bar needs a clean douwebot APPROVE on the current head; reason file ready at scratchpad/pydanty-dismiss-reason.md
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#issuecomment-6505813114
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · douwebot CHANGES_REQUESTED at 98fc7239b: converge the server_tool_use filter on provisions_code_execution — pending David · iter -
- Decision: Pending David: douwebot (review 5703486421, thread comment 4416731262) asks _get_enabled_server_tool_names to call provisions_code_execution(native_tools) instead of its own name/profile check, optionally typing the predicate Sequence[BetaToolUnionParam]; PLAN §2.2 says PR 2 'Does not. Touch the filter', so it moves a planned #10489 hunk into this PR; no code changed yet
- Why: Verified no-op by reading: only map_code_execution_tool emits name 'code_execution' (type code_execution_*); _add_native_tools maps every WebSearchTool/WebFetchTool and emits 20260209 iff the same anthropic_supports_dynamic_filtering read is on; the suggested hunk equals #10489's at 278ecafe1; CI tests/coverage green, the 3 failures are the douwebot-approval gate checks
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#discussion_r4416731262
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · pydanty review 5702926557 dismissed (David approved) · iter -
- Decision: David approved dismissing pydanty's addressed CHANGES_REQUESTED 5702926557; the manager ran dismiss-addressed-bot-review with scratchpad/pydanty-dismiss-reason.md; review state DISMISSED (timeline review_dismissed 2026-10-29T19:16:12Z by dsfaccini)
- Why: Required findings 2, 3, 5 fixed in 98fc7239b; 1 and 4 declined with evidence in issuecomment-6505813114; the session's own attempt was denied by the auto-mode classifier
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#issuecomment-6505813114 (David via manager relay, local-notes/dispatch-20261029T191717Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · douwebot 5703486421: option (A), converge the filter on provisions_code_execution with the SDK type · iter -
- Decision: David picked (A): _get_enabled_server_tool_names calls provisions_code_execution(native_tools) in place of its two checks; the predicate takes Sequence[BetaToolUnionParam], matching #10489 at 278ecafe1 minus its allowed_callers clause (stays #10489's). Deliberate change to PLAN §2.2 'Does not. Touch the filter'
- Why: One definition of 'has code execution'; behavior-neutral (only map_code_execution_tool emits name code_execution; 20260209 web tools emitted iff the same anthropic_supports_dynamic_filtering read); douwebot APPROVE gates the merge; leave 5703486421 for the new verdict to supersede (dismissal needs David)
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#discussion_r4416731262 (David via manager relay, local-notes/dispatch-20261029T200104Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
- Supersedes: douwebot CHANGES_REQUESTED at 98fc7239b: converge the server_tool_use filter on provisions_code_execution — pending David
2026-10-29 · push 02c7f95e7 (filter convergence) without a pre-push review: budget exhausted · iter -
- Decision: Runtime change 98fc7239b..02c7f95e72e0020ca7b0ae3d309e41f497044812 pushed un-reviewed by budget exhaustion (3/3 used; last reviewed e1d3aa797); douwebot re-applied on the new head as the review
- Why: Local checks: ruff + pyright clean on both modules and touched tests; filter, web tools, unpaired, stream parity, tool search, code execution files, canonical system and test_anthropic container/server tool nodes pass; #10489 harnesses vs main: filter and repro_filter_result identical to main, matrix and diff_container byte-identical to the 98fc7239b head output (same 84 / 20 direct-API no-code-execution rows as before)
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#discussion_r4416731262
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-29 · douwebot thread resolved; douwebot re-applied at 02c7f95e7 · iter -
- Decision: Replied on douwebot thread (discussion_r4418179254), +1, resolved; PR body updated (filter sentence, test anchors, web fetch case, filter harness line, 2026-10-29 decision mirror); douwebot label applied on head 02c7f95e72e0020ca7b0ae3d309e41f497044812; review 5703486421 left for the new verdict to supersede
- Why: Dismissing 5703486421 needs David's say-so (dispatch-20261029T200104Z); merge bar needs a clean douwebot APPROVE on the current head
- Source: https://github.com/pydantic/pydantic-ai/pull/11764#discussion_r4418179254
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-30 · no pushes on the approved head except for blocking findings · iter -
- Decision: 'Push only for a blocking finding, a red check, or a conflict. Otherwise reply on the note, or record it for a follow-up.' Applies from 02c7f95e7 (merge bar met, David merging); a non-blocking or Optional note still gets addressed per pushing-commits-to-the-repo, by reply or follow-up record, not a commit
- Why: Each push resets douwebot's approval and costs a full review cycle
- Source: https://github.com/pydantic/pydantic-ai/pull/11764 (David via manager relay, local-notes/dispatch-20261030T033642Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-30 · PR watch is standing lifecycle: re-arm without asking · iter -
- Decision: The 10-minute event-only poll runs until the merge; re-arming it after it stops (including a low-memory kill) 'needs no ask'. Report only on a new comment, review or commit, a red check, or the merge or close
- Why: Watching to merge is the standing PR lifecycle
- Source: https://github.com/pydantic/pydantic-ai/pull/11764 (David via manager relay, 2026-10-30)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-10-30 · pushes at the merge bar: douwebot inline notes included · iter -
- Decision: 'push to fix a douwebot inline note (optional included), a blocking finding, a red check or a conflict. Don't push for anything else while the PR is at the merge bar.'
- Why: Gate: clean douwebot approval fails on any douwebot comment on the head (pushing-commits-to-the-repo SKILL.md: 'Clean means douwebot APPROVE on the current head, with no douwebot comments on that head'), so an inline note costs one fix push plus one douwebot cycle (precedent: cx-webcite on #10489)
- Source: https://github.com/pydantic/pydantic-ai/pull/11764 (David via manager relay, local-notes/dispatch-20261030T033827Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
- Supersedes: no pushes on the approved head except for blocking findings
2026-11-01 · reconcile provisions_code_execution after #10489 merged (d44704ec7) · iter -
- Decision: Merged upstream/main into 87968338f; kept main's provisions_code_execution (#10489: reads allowed_callers when present, else code_execution_* and 20260209 web tool types) as the single definition; both call sites (_get_container, _get_enabled_server_tool_names) use it, so _native_tools.py and the filter leave this PR's diff. Behavior change: a 20260209 web tool with anthropic_web_tools_allowed_callers=['direct'] no longer sends the history container; a code execution caller on the previous web tool version sends it. Pinned as by_client cases api-web-search-direct and api-web-search-20250305-code-execution-caller. Removed #10489's known-limitation text (allowed_callers docstring, Web Tool Callers last paragraph); anthropic_container docstring and Code Execution Containers docs now state the merged rule
- Why: Merged semantics are right: a direct-only web tool can't be called from code execution, so the request has none and the API rejects the container (400 'Container identifier can only be provided when using the code execution tool', req_011CgRC4pgDK6YWqccY3ahYS) — the defect #10489 documented as a known limitation; a code execution caller provisions the sandbox on any version (#10489 recording after req_011CgRUDkdW2HPh1BpR61Xzc reads back from the container)
- Source: https://github.com/pydantic/pydantic-ai/pull/10489 (merged d44704ec7; David via manager relay, local-notes/dispatch-20261101T143912Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
- Supersedes: provisions_code_execution: two definitions across #11764 and #10489
2026-11-01 · push 87968338f (main merge with conflict resolution) without a pre-push review: budget exhausted · iter -
- Decision: Merge with conflict resolution (not the exempt no-conflict merge row) plus docs and two test cases, pushed un-reviewed by budget exhaustion (3/3 used); douwebot re-applied on the new head as the review
- Why: Local checks: ruff + pyright clean on the anthropic model, _native_tools, profile and test files; test_code_execution_files, test_native_tool_filtering, test_web_tools, test_canonical_system and the two test_anthropic container nodes pass
- Source: https://github.com/pydantic/pydantic-ai/pull/11764
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-11-01 · red check after the main merge: #11774's endpoint-scoping test gets code execution (36ca03423) · iter -
- Decision: test_anthropic_container_from_history_scoped_by_endpoint (from #11774, arrived with the main merge) ran its follow-up without code execution, so this PR's gate withheld the container in [same-endpoint]; its follow-up agent now has NativeTool(CodeExecutionTool()). Pushed under the exempt row 'Missing coverage, test-harness repairs' (test-only; its endpoint-scoping assertion unchanged); douwebot re-applied
- Why: The only failure across all 10 failed CI jobs at 87968338f (run 41317806731); a container on a request without code execution is the 400 this PR removes, so the test needs code execution to observe endpoint scoping; test_anthropic container/code_execution/endpoint nodes, test_server_state, test_continuation_stream, test_code_execution_files pass locally
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/41317806731
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-11-01 · Mantle container probe: stopped, no Claude model reachable and no code execution on Mantle · iter -
- Decision: No code change, no push; reported to David per the dispatch's 'anything else' branch. Probe (AsyncAnthropicBedrockMantle, AWS_PROFILE creds from the base env file, us-east-1): newest available Claude model per Mantle GET /v1/models is anthropic.claude-opus-5-5 (created 2026-09-12); a (code execution), b (bogus container, no tools), c (container + code execution), d (control, no tools) all 403 permission_error 'anthropic.claude-opus-5-5 is not available for this account' (a req_zudp3ae6yij4tkyb6k3rd5wcc2frjeok54ittcqbq3nk6tumlpuq, b req_mlsgu5bqbiun6l4i7epfxdjzsovqit7zo6fk2oqnw72bygcvm46a, c req_kyalq2vlg5kbmby363glkkf6h7dfgvk3m5igp464tthk7bc4bfkq); same 403 on opus-5, sonnet-5, opus-4-8, opus-4-7, haiku-4-5; no Bedrock bearer token configured. Traces went to the LOGFIRE_TOKEN project, which isn't the pydantic-ai project the Logfire MCP reads: no trace link
- Why: Main already records Mantle rejecting both code execution tool versions on opus-5-5 (#11790, test_code_execution_tool_rejected_by_bedrock[mantle-opus-5-5-*]: 'tool type ... is not supported for this model'); AnthropicModel advertises neither CodeExecutionTool nor the web tools on Mantle, and accepts_server_state (#11774) only reuses a container at the endpoint that created it, so Mantle never has a history container; steps a and c can't run as specified
- Source: https://github.com/pydantic/pydantic-ai/pull/11764 (David via manager relay, local-notes/dispatch-20261101T155620Z.md; results scratchpad/mantle_probe/probe-*.json)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
2026-11-01 · drop anthropic_rejects_container_without_code_execution and the unverified-clients carve-out (David) · iter -
- Decision: David decided: settle the Mantle sentence from the docs and delete _CONTAINER_WITHOUT_CODE_EXECUTION_UNVERIFIED_CLIENTS, the AnthropicModelProfile.anthropic_rejects_container_without_code_execution field and its wiring, so every client follows the Claude API rule (no history container on a request without code execution); Mantle cases in test_anthropic_history_container_without_code_execution_by_client flipped to not sent; Mantle sentence and profile-field link removed from the Code Execution Containers docs, the _get_container and _instance_profile_defaults docstrings and the PR body; no more probes
- Why: Verified: (1) Anthropic's Claude in Amazon Bedrock page (covers the bedrock-mantle /anthropic/v1/messages endpoint) lists 'Server-side tools (code execution, web search, web fetch, advisor)' under 'Features not supported'; (2) main records Mantle rejecting both code execution tool versions (#11790, test_code_execution_tool_rejected_by_bedrock[mantle-opus-5-5-20250825/20260120]) and _CODE_EXECUTION_UNSUPPORTED_CLIENTS includes AsyncAnthropicBedrockMantle; (3) since #11774 the history scan in _get_container reuses a container only where accepts_server_state holds, i.e. at the endpoint that created it, so Mantle never has one; (4) AsyncAnthropicVertex and AsyncAnthropicFoundry are in _FILE_AND_CONTAINER_IDS_UNSUPPORTED_CLIENTS and never send container ids; (5) probe: Bedrock model access is AUTHORIZED and the use-case form submitted, yet Mantle returns 403 permission_error on every Claude model (opus-5-5 req_zudp3ae6yij4tkyb6k3rd5wcc2frjeok54ittcqbq3nk6tumlpuq, req_mlsgu5bqbiun6l4i7epfxdjzsovqit7zo6fk2oqnw72bygcvm46a, req_kyalq2vlg5kbmby363glkkf6h7dfgvk3m5igp464tthk7bc4bfkq; same on opus-5, sonnet-5, opus-4-8, opus-4-7, haiku-4-5). Main has no such field, so removing it breaks nothing
- Source: https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock (David via manager relay, local-notes/dispatch-20261101T162153Z.md)
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
- Supersedes: split from #10489: PR 2 of 3, plan approved (profile key only)
2026-11-01 · push b4d600a9e (carve-out removal) without a pre-push review: budget exhausted · iter -
- Decision: Runtime change 36ca03423..b4d600a9e pushed un-reviewed by budget exhaustion (3/3 used); douwebot re-applied on the new head as the review
- Why: Local checks: ruff + pyright clean on the anthropic model, profile and test files; test_code_execution_files, test_code_execution_clients, test_native_tool_filtering, test_web_tools, test_canonical_system, test_server_state, tests/profiles and the test_anthropic container/code_execution/endpoint/profile nodes pass
- Source: https://github.com/pydantic/pydantic-ai/pull/11764
- Session: 886e520f-ec3f-460c-8e65-e54efb0d6bbb
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.