How hand-offs work

What happens when the lead gives a task to a bot, step by step, with every limit.

This page explains exactly what happens between your message and the final answer when a team is involved, including every limit.

What the lead knows#

When a project has a team, every time you send a message the lead's instructions get an extra section listing the bots it may hand work to, one line each:

- researcher (Researcher): Explores the codebase and answers questions about how things work. Read-only.
- tester (Tester): Runs the build and tests, and writes or fixes tests.

Together with the list, the lead gets one extra tool, delegate. It also receives guidance: delegate when part of the job is self-contained or can run in parallel, do small or tightly coupled work yourself, give the bot all the context it needs, and check the report before relying on it.

If the lead may not hand work to anyone (no bot ticked), neither the list nor the tool is sent, and nothing changes.

The delegate tool#

Parameter Meaning
bot The id of the teammate. Only ids the caller is allowed to use are accepted.
task The complete task, in plain language.

The task is all the bot sees. It does not see your conversation, the lead's earlier messages, or other bots' work. A good task states the goal, where to look, and what to return:

Find every place where user input is validated for the signup form.
Look under src/ and server/src/. Return a list of file:line with one
sentence each on what is checked. Do not change anything.

What happens, step by step#

  1. You send a message. Peridot reads the team from .peridot/team.json fresh from disk, so edits made since the last message apply.
  2. The lead's model turn. It may answer directly, or call delegate one or more times.
  3. The bot starts. Each delegate call starts a separate agent run for that bot with:
    • a new, empty conversation containing only the task,
    • the bot's own system prompt: its name, role, your instructions, the working rules, and who gave it the task,
    • only the tools you gave it, plus delegate if it may hand work on,
    • its own model, or the chat's model if none is set.
  4. The bot works. It reads, searches, edits and runs commands like any agent: model turn, tool calls, results, repeat.
  5. The bot reports. When it stops asking for tools, its final message is the report.
  6. The lead continues. The report arrives as the result of the delegate call. The lead reads it, may hand out more work or do something itself, and finally answers you.

In the chat you see one card per hand-off, Hand to Researcher: …, with a spinner while it runs and a check mark when done. Click the card to read the report. While a bot works, the edits and commands it wants to make (the ones that need approval) also appear in the chat, labelled with the bot's name.

Parallel work#

If the lead calls delegate several times in the same turn, all those bots start at once and work in parallel. The lead continues when every one of them has reported. Other tools called in the same turn run one after another, as usual.

Limits#

Limit Value
Bots in a team 12
Hand-off depth 2. The lead gives work to a bot (depth 1), which may give work to another bot (depth 2). A bot at depth 2 cannot delegate further.
Steps per bot 25 model turns. If a bot runs out, the lead gets an error and can retry or take over. (The lead has 40.)
Size of a report 8,000 characters. Longer reports are cut, so ask for a short report.
Task and context The task is all a bot gets. It has no memory of earlier runs.

Bots can be allowed to hand work to each other in a cycle (A to B and B to A). The depth limit stops any loop.

Approvals#

Edits and commands by a bot ask you for approval just like the lead's, using the same approval mode (Manual or Auto approval) you chose in the input.

When several bots ask at once, the requests are queued and shown one at a time: answer the card on screen and the next one appears. Each card names the bot that is asking.

Note

Approval cards are shown in the chat. If a run seems stuck while the graph is open, switch back to the chat: a bot may be waiting for your answer.

A Deny is returned to the bot, which is told not to retry and to ask or adjust. It usually mentions this in its report.

Failures and stopping#

What is stored#

Usage and cost#

Every model turn of every bot is a normal request. It counts toward your daily messages and monthly allowance and is billed on the model it used. A team that runs three bots for ten steps each uses about thirty times what one step costs. Parallel work is faster, not cheaper. Use a fast model for exploring bots, ask for short reports, and keep the lead's job to coordinating. See Accounts and plans.

Plugins and bots#

Tools added by plugins are offered to the lead only. Bots work with the six built-in tools.

← Creating bots The graph and activity →