Skip to main content
Tools

Agent-to-Agent Messages

Let one agent hand work to another agent without waiting for it.

A tool can send another agent a message. Here a coder agent hands a finished branch to the reviewer for that repository and keeps working.

Coder agentReviewer agentkey: repositorySchedulerequestReviewreturns right awayafter(0)prompt
  • The reviewer is keyed by repository, so every coder working on the same repository reaches the same reviewer, and its session remembers past reviews.
  • requestReview schedules the reviewer’s prompt and returns, so the coder’s tool doesn’t wait for the review. The schedule is saved with the reviewer, so the review runs even if the coder’s request goes away.
  • streamingBehavior: "followUp" queues the request when the reviewer is busy with another review. Use it with prompt, not the followUp action, which only queues on an idle agent and never starts a run.

To wait for the other agent’s answer instead, see Subagents. See Schedules for more on c.schedule.