Skip to content

fix(runner): skip parallel_tool_calls default for WebSearch agents on Anthropic - #324

Merged
ryw merged 2 commits into
mainfrom
fix/websearch-parallel-tool-calls
Jul 20, 2026
Merged

fix(runner): skip parallel_tool_calls default for WebSearch agents on Anthropic#324
ryw merged 2 commits into
mainfrom
fix/websearch-parallel-tool-calls

Conversation

@ryw

@ryw ryw commented Jul 20, 2026

Copy link
Copy Markdown
Member

Follow-up to #322, caught by post-deploy verification: the dogfood run of competitor-monitoring-digest failed with a new 400 —

tool_choice.disable_parallel_tool_use: true cannot be used with programmatic tool calling

On pydantic-ai 2.x, Anthropic's web_search tool runs with server-side programmatic tool calling (code-execution-assisted search). The API rejects disable_parallel_tool_use combined with it as soon as the agent also declares a client/MCP tool — which the digest agent does (produce_inbox_item). My #322 smoke test had WebSearch but no client tools, so tool_choice was never sent and the clash didn't surface.

Fix: build_agent skips the sequential-tool-calls default (and drops an explicit spec value with a stderr warning) for WebSearch agents on Anthropic models. Everything else keeps the sequential default (the Attio rate-limit guard).

Verification:

  • Reproduced the exact 400 locally (WebSearch + sidecar tool on claude-sonnet-5), passes with the fix (run completes, tool called)
  • 11/11 wrapper unit tests pass, including a new regression test

🤖 Generated with Claude Code

ryw and others added 2 commits July 20, 2026 10:49
Tembo CAP renamed the public task route mount with no back-compat alias
(tembo/monorepo#9519, deployed 2026-07-16). Since then every agent-change
dispatch from TAS has failed: /public-api/task/create now falls through
to CAP's Zenstack catch-all, which 400s with
{"error":{"message":"invalid request path"}}. Same handler and
response shape behind the new mount, so this is only the path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… Anthropic

Follow-up to the pydantic-ai 2.13.0 upgrade: Anthropic's current
web_search tool runs with server-side programmatic tool calling, and the
API 400s on tool_choice.disable_parallel_tool_use combined with it as
soon as the agent also has a client/MCP tool:

  400 tool_choice.disable_parallel_tool_use: true cannot be used with
  programmatic tool calling

The wrapper's sequential-tool-calls default (and any explicit spec
value, with a stderr warning) is now skipped for WebSearch agents on
Anthropic models. Non-WebSearch agents keep the sequential default.

Verified: the WebSearch + sidecar-tool repro that 400'd now completes;
11/11 wrapper tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryw
ryw merged commit f903ab9 into main Jul 20, 2026
9 checks passed
@ryw
ryw deleted the fix/websearch-parallel-tool-calls branch July 20, 2026 15:03
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.

1 participant