← All tutorialsSHARING AND TEAMS

How to close the AI code review loop: let your review bot message the agent that wrote the PR

Give your review bot its own PeerBand account and share your machine with it using peerband share --message. When review finds a problem, the bot calls send_agent_message on the agent behind the PR. The agent fixes it, pushes, and tells you with peerband notify.

How the loop works

  1. Your agent opens a PR and waits.
  2. The review bot reviews it and finds a problem.
  3. The bot finds the agent that wrote the PR and sends it the review comments through PeerBand.
  4. The agent reads them, fixes the code, pushes and answers the review.
  5. When review passes, the agent sends you a note: peerband notify "PR #482: review fixed, approved".

You only step in when it's ready, or when the agent asks you to decide something.

1. Share the machine with the bot

On the machine where your agents run:

peerband share --message --expires 1

Sign in as the bot account, open the invite link and accept. --message lets the bot send messages, not only read. The link works once and expires after the days you set (7 by default).

2. Connect the bot's MCP client

Add https://mcp.peerband.com/mcp to the bot's MCP client, signed in as the bot account, and approve agents:message. For a CI job that can't open a browser, use a personal MCP token from the bot account's dashboard where tokens are enabled, stored as a CI secret.

3. Point the bot at the right agent

The bot must address the exact agent that wrote the PR, not whichever pane is focused. Ask your agents to name their machine and Herdr workspace in the PR description, for example in your AGENTS.md:

In every PR description, add a line: PeerBand: machine office-pc, workspace api.

The bot then calls list_machines and list_agents, picks the agent in that workspace, and sends the review with send_agent_message. It can call wait_for_agent to know when the fix is in.

Why the agent can trust the bot, but only so far

Every relayed message starts with a header naming its sender. The bot is a shared user, so your agent sees:

[PeerBand relay] From shared user review-bot@example.com, who is NOT the owner of this machine and reaches it through a PeerBand share. …

The PeerBand skill tells the agent to treat it as a coworker: work on the task, keep your secrets private, and ask you before anything risky. To give the bot more or less room, edit the guest rules in the skill. See sender identity and guest rules.

Questions

Is there a ready-made GitHub Action for this?

Not yet. It's a pattern you build with sharing and the MCP tools: any review bot that can call an MCP server can take part.

How is this different from Devin or Cursor Bugbot autofix?

Those fix code inside their own product. This sends the feedback to the agent you already have, on your machine, whichever agent it is, with its full context of the change.

Can I see what the bot sent?

Yes. The dashboard keeps a metadata-only log of guest activity for 30 days: what was read or sent and when, never the messages or output.