On an eventNeeds a repository

Fix a bug from an alert

A PR with checks

Your alerting posts to a webhook trigger; an agent reproduces the failure, fixes it and opens a pull request with the checks passing.

View .md

Best for

  • On-call teams with alerts that point at code
  • Failures a test can reproduce

Uses

  • A connected GitHub repository
  • A Project
  • An automation with a webhook trigger

Automation · Fix from alert

POST /o/{org}/p/{project}/automations/{automation}/triggers
promptAn alert fired; its payload follows. Reproduce the failure with a test, fix it, and open a pull request. If you cannot reproduce it, say what you tried.
{
  "kind": "webhook"
}
Fig. The automation: its prompt, and the trigger that starts a run. Field names are the API's.

Watch it work, then read what comes back

GET /o/{org}/sessions/{session}/events
event: thinkingThe stack trace points at retry.ts:88.
event: tool_useedit · retry.test.ts (reproduces it)
event: tool_result1 failed
event: tool_useedit · retry.ts
event: tool_result12 passed
event: messageOpened a pull request with the fix and the test.
Fig. The live stream while it works. Event names are the stream's.
GET /o/{org}/sessions/{session}
status
completed
branch
rush/fix-retry-timeout
pr_url
github.com/acme/api/pull/…
total_cost_usd
0.88
Fig. The session when it ends. Field names are the API's.

Steps

  1. 01

    Add a webhook trigger

    Create an automation with the prompt above and a webhook trigger. Rush shows its URL and signing secret once.

  2. 02

    Point your alerting at it

    Send the alert's payload to the trigger URL. The payload reaches the agent as untrusted data after your prompt, never as instructions.

  3. 03

    Fire a test alert

    A run starts per alert. Duplicate deliveries are deduplicated, and a busy or rate-limited automation reports why it skipped.

  4. 04

    Review the pull request

    The run opens one pull request on its own branch. When the checks do not pass, the run ends needs_review, never a false done.

In the API and the docs