GitHub App Planned
Planned
@chamberu/github is planned. Names and options may change.
One App per agent repository
Each agent repository (and so each image) gets its own GitHub App, with its own webhook URL, App credentials and Secret. There is no shared intake router: an App's webhooks go straight to the app that owns it.
The App needs the permissions its tools use (for triage: issues read and write, metadata read, contents read) and subscribes to the events its triggers name.
Webhooks
The planned connector mounts POST /webhooks/github into the HTTP app and:
- verifies
X-Hub-Signature-256against the raw body and rejects anything else with401, - matches the event and action (
issues.opened,pull_request.synchronize, ...) against the agents'github.webhook()triggers, - ignores events sent by the App itself, so the agent does not trigger itself,
- dispatches with the delivery id (
X-GitHub-Delivery) as the idempotency key and, by default,<owner>/<repo>#<number>as the concurrency key, - answers
202right away; the run happens asynchronously.
Tools
Installation tokens are short-lived, cached per installation until they expire and never logged. Read tools cover issues, labels, search, pull requests, files and releases. Write tools are effect tools:
- adding labels is naturally idempotent,
- comments embed an
effectMarkerandalreadyAppliedsearches for it before posting, so a crash between posting and recording does not post twice, - closing an issue is meant to sit behind an approval.
Sandboxes never get the App's credentials. When a tool must push, the connector creates a short-lived token scoped to one repository.
What works today
You can already write GitHub tools as effect tools with your own Octokit client and dispatch runs from your own webhook handler, using the delivery id as idempotencyKey. The effect tools page shows the comment pattern.