Repository navigation
feat(deploy_agent): a peer_tools option to leave out the peer_agents tools - #836
Merged
Merged
Conversation
A deploy_agent step can already narrow an agent's own tools with builtin_tools, but every claude-code turn still got the SDK's peer_agents MCP tools, and only code (the always-on verifier's judge) could turn them off. A task now sets peer_tools: false on the step. It is checked against the agent's agent-config before the first request (an agent that can't take it fails the deploy), sent with the identity, kept on the card, and sent again on each prompt_agent and always_on turn like builtin_tools, including to a peer user sim, which until now got neither again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cikowski
requested changes
Nov 20, 2026
cikowski
left a comment
Collaborator
There was a problem hiding this comment.
The deploy side is good: checked against the card before the first request, sent once with the identity, kept on the card, and unset is a no-op.
One gap before this goes in. The per-turn resend doesn't cover a user sim deployed with deploy_user_sim_agent, in prompt_agent or in always_on. That step takes peer_tools like any deploy_agent, and a tool-less user sim is the case this PR is for, so the main way to get one is the path that never gets the setting again after a restart. Details inline. Greptile raised the same thing, and its check is red until that thread is resolved.
Also: please retitle to feat(deploy_agent): ... so the release notes pick it up correctly.
…ool settings again too prompt_agent and always_on sent the saved builtin_tools and peer_tools again to the agent and to a peer user sim, but not to a user sim deploy_user_sim_agent deployed, since its model and prompt are already set; one that restarted got its tools back. A2AAgent.tool_settings(card) builds the two fields from a card for all three, and resend_tool_settings sends a built-in user sim its own. always_on's own user-sim setup sends them as well. A test pins that peer_tools true on an agent whose agent-config doesn't take it is dropped by negotiation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
approved these changes
Nov 22, 2026
test_prompt_agent_built_in_user_sim.py: both sides added a test at the same place; both kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A
deploy_agentstep can narrow an agent's own tools withbuiltin_tools, but every claude-code turn still gets theSDK's peer_agents MCP tools, which message the task's other agents. Only code could turn them off: the always-on
verifier does it for its judge. An agent that should have no tools at all, such as an LLM user sim, keeps six it
shouldn't have, even in a task with nothing for it to reach.
deploy_agentnow takespeer_tools: false, handled likebuiltin_tools:peer_toolsfails the deploy instead of keeping the tools.
prompt_agentandalways_onturn, so an agent that restarted doesn't get the tools back.A peer user sim now gets its
builtin_toolsandpeer_toolsagain each turn too; until now it got neither afterdeploy.
Leaving
peer_toolsunset changes nothing.How it was tested
test_deploy_agent_role_delivery.py: false is sent once with the identity and kept on the card;unset sends nothing; an agent that can't take it fails before any request; the field round-trips and must be a
bool. In
test_prompt_agent_builtin_tools.py: each turn resends it, and a user sim gets its own tools and peer toolseach turn. The two resend tests fail without the
prompt_agentchange.pytest tst/unit/task_step tst/unit/agents: the same failures as onmainand no new ones (they need sandboxprovider modules that aren't installed locally).
make lint: passed.builtin_tools: {"disable": "*"}andpeer_tools: false, then oneprompt_agentturn with anoutput_format. The CLI's session log shows the model wasoffered only
StructuredOutput, and the turn answered through it. Withbuiltin_toolsalone, the same agent isoffered
StructuredOutputplus the sixmcp__peer_agents__*tools. The sandbox was terminated.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Adds
peer_tools: falsetodeploy_agentand carries saved tool settings into laterprompt_agentandalways_onruns.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD D["deploy_agent: peer_tools false"] --> C{"Card supports peer_tools?"} C -->|No| F["Fail deployment"] C -->|Yes| S["Send settings and save on card"] S --> P["prompt_agent"] S --> A["always_on"] P --> R["Resend saved tool settings"] A --> R R --> M["Claude Code omits peer_agents"]Reviews (8) · Last reviewed commit: "Merge main into kai/deploy-agent-peer-to..." · Reviewed by Greptile