Skip to content

feat(deploy_agent): a peer_tools option to leave out the peer_agents tools - #836

Open
kaihackney-scale wants to merge 3 commits into
mainfrom
kai/deploy-agent-peer-tools-option
Open

kaihackney-scale wants to merge 3 commits into
mainfrom
kai/deploy-agent-peer-tools-option

Conversation

@kaihackney-scale

@kaihackney-scale kaihackney-scale commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

A deploy_agent step can narrow an agent's own tools with builtin_tools, but every claude-code turn still gets the
SDK'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_agent now takes peer_tools: false, handled like builtin_tools:

  • It's checked against the agent's card before the first request. An agent whose agent-config takes no peer_tools
    fails the deploy instead of keeping the tools.
  • It's sent with the agent's identity and kept on its card.
  • It's sent again on every prompt_agent and always_on turn, so an agent that restarted doesn't get the tools back.
    A peer user sim now gets its builtin_tools and peer_tools again each turn too; until now it got neither after
    deploy.

Leaving peer_tools unset changes nothing.

How it was tested

  • New unit tests in 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 tools
    each turn. The two resend tests fail without the prompt_agent change.
  • pytest tst/unit/task_step tst/unit/agents: the same failures as on main and no new ones (they need sandbox
    provider modules that aren't installed locally). make lint: passed.
  • End to end: a claude-code agent deployed on a live sandbox with builtin_tools: {"disable": "*"} and
    peer_tools: false, then one prompt_agent turn with an output_format. The CLI's session log shows the model was
    offered only StructuredOutput, and the turn answered through it. With builtin_tools alone, the same agent is
    offered StructuredOutput plus the six mcp__peer_agents__* tools. The sandbox was terminated.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous built-in user issue is fixed.

Summary

Adds peer_tools to deploy_agent and preserves saved tool choices when starting later conversations.

  • Agents can keep peer messaging tools turned off across turns.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Deploy["deploy_agent settings"] --> Check["Check card support"]
  Check --> Send["Send settings and save on card"]
  Send --> Prompt["prompt_agent setup"]
  Send --> Always["always_on setup"]
  Prompt --> Resend["Resend each agent's saved tool settings"]
  Always --> Resend
Loading

Reviews (2) · Last reviewed commit: "fix(deploy_agent): a user sim deploy_use..." · Reviewed by Greptile

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>
@kaihackney-scale
kaihackney-scale requested a review from a team as a code owner November 20, 2026 02:31

@cikowski cikowski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

kaihackney-scale and others added 2 commits November 20, 2026 18:53
…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>
@kaihackney-scale kaihackney-scale changed the title deploy_agent: a peer_tools option to leave out the peer_agents tools feat(deploy_agent): a peer_tools option to leave out the peer_agents tools Nov 20, 2026

This branch has not been deployed

No deployments
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.

2 participants