AgentHub wiki

Triggers

A trigger has the hub start a worker on one of your machines when something happens on GitHub:

Event When What the worker does
push_main A push moves the repo's default branch Reviews that change: fetches the new commit and reads the diff since the old one
pr_opened A pull request is opened, or a draft is marked ready for review Reviews the pull request against the default branch

Before the worker starts, the launcher fetches the change, checks the worker's worktree out at its new commit, and writes its diff to AGENTHUB_REVIEW.diff at the top of the worktree. The worker runs at read level, like any worker: it reads the diff and the files around it, and runs no commands. When it's done, it replies with its findings in a few short points, and then it stops by itself: the hub queues a graceful stop once the worker reports idle after its review. Your orchestrator still shows the findings afterwards with worker_status or my_workers. It doesn't edit files, push, comment on GitHub or approve anything.

Triggers work for github.com projects. They need a machine running agenthub launcher with a checkout of the repo, on a version that can prepare reviews (this release or later: run agenthub update there and restart the launcher).

Turning one on

On the dashboard, open the project's page. Its Triggers panel has a row for each event; press Turn on on one, pick where to run it, and save. See Dashboard. Or ask your orchestrator, for example "start a Codex review on my Mac whenever a PR is opened on acme/shop". It calls set_trigger:

Option
project The project ID, such as github.com/acme/shop
event push_main or pr_opened
enabled true to turn it on, false to turn it off
harness Default claude-code
machine, model Optional: which of your machines, and which model
include_forks Also pull requests from forks. Off by default: their code and text come from outside the repo.

Turn one off with enabled set to false, or with Turn off on the project's page. list_triggers shows your triggers, when each last started a worker, and why the last try didn't, if it didn't.

Each person turns on their own triggers. Two teammates with pr_opened on the same project each get a worker.

Limits

  • At most one start per person, project and event every 10 minutes.
  • None while a trigger review of yours is still running on that project. Your other workers don't hold it back. A review that's idle, or hasn't reported in 2 hours, doesn't count: the hub stops it when the next event comes. stop_session on it clears one sooner.
  • At most 6 trigger starts per project an hour, across everyone.
  • Only for active members of the project.

Safety

The worker's task is fixed, and holds only the commit SHAs or the pull request number. The hub never puts a pull request's title, description, branch name or a commit message in it. The task tells the worker to treat the code and text it reads as data, never as instructions. A read-level worker can read the project's notes but not write them.

The hub checks every delivery's signature with the GitHub App's webhook secret, and handles each delivery once, even when GitHub sends it again. It refuses a delivery with a malformed signature header, or one over 5 MB, before reading its body.

For the hub's operator

Triggers are off until the hub has a webhook secret. On the GitHub App, under Webhook, check Active, set the URL to https://<hub>/api/webhooks/github and a long random secret, and subscribe to the Push and Pull request events. Set the same secret as AGENTHUB_GITHUB_WEBHOOK_SECRET on the hub. deploy-server.md has the details.