Hand a pull request to an agent
When a task’s agent opens its pull request on GitHub, the agent keeps it. Agents reads the pull request each time it polls GitHub and wakes the agent when something on it needs a fix.
What wakes the agent
Section titled “What wakes the agent”- The ship loop fails the pull request, stops it, or uses every review round. Only repos that run the ship loop have one.
- A check fails on a head the ship loop never posted on. Agents waits until no check still runs.
- Someone on the team asks for changes, comments in a review with text, or leaves line comments. On a public repo, the team is the repo’s owner, the members of its organization and its collaborators. On a private repo it is anyone who can post. An app’s account never counts.
Only posts and failures on the current head from the last 24 hours count. Agents waits until the newest post is 2 minutes old, so a run of single comments wakes the agent once. When a review is still waiting while another wake’s fix is pushed, it moves to the head that push made, so the review is not lost.
What a woken agent does
Section titled “What a woken agent does”The agent gets a turn nobody watches. It can read and edit the task’s files and nothing else, so it runs no commands, asks nobody and posts nothing on GitHub. What it was told arrives as data, never as instructions. A teammate’s comment may ask it to change a test, and it may then edit that test. When it reports the findings fixed, Agents commits its edits and pushes them to the pull request’s branch. When it ends without a push, a person reads one line saying which pull request needs them, in the chat the task came from or in the task owner’s direct message with the agent.
A pull request wakes its agent for at most 6 fixes, and after that the line goes to a person. A server that sets AGENTS_SHIP_WAKE=off wakes nobody.
Have the agent answer a teammate
Section titled “Have the agent answer a teammate”Ask in the task, for example “answer ada’s review”. The agent reads the pull request with read_pull_request, which shows each teammate’s post with a key such as review:31, and calls reply_to_thread with that key and its words. It replies only in a turn a person asked for, so a woken agent or a pipeline stage never replies, and only on its task’s own open pull request on GitHub.
It answers a post by a person on the team, and refuses one from outside the team, from an app’s account or from Agents. A reply to a line comment goes into that comment’s thread, and a reply to a review or a comment is a new comment that names the author and links the post, since GitHub threads only line comments. The reply posts with the GitHub sign-in of whoever added the repo to its project, or the team’s token when they have none. Its last line, such as “Sent by fixer, an agent in Agents.”, names the agent, and a post ending in that line never wakes an agent. A reply holding a secret value is refused and nothing is posted, whether a known pattern matches it, the server keeps it, or only the agent’s computer keeps it, as in a repo’s .env file. Links inside the team’s network and email addresses are taken out, and the agent is told what went out. The same words sent twice to the same post post once.