GitHub Integration

Connect GitHub repositories to trigger automated agent workflows from events.

Syntropic137 integrates with GitHub through a GitHub App. This enables webhook-driven workflow automation: PRs opened, pushes to branches, issues labeled, and more can automatically trigger agent workflows.

Setting Up the GitHub App

The setup wizard's init command offers to create the GitHub App:

npx @syntropic137/setup init

If you accept, it opens your browser to GitHub's App manifest flow:

  1. You confirm the app creation on GitHub
  2. GitHub redirects back with credentials
  3. The CLI saves the private key (PEM), webhook secret and client secret to ~/.syntropic137/secrets/, and writes the App ID, App name, org and webhook secret to .env
  4. You choose which repositories the app can access

The entire flow takes about 30 seconds.

To change an existing App's settings or installations, run npx @syntropic137/setup github-app. It opens the App's settings, permissions or installations page on GitHub; it does not create an App.

Trigger Rules

A trigger rule connects a GitHub event to a workflow. When a matching event arrives, Syntropic137 evaluates conditions and safety guards, then either fires the workflow or records a block with the reason.

# Create a trigger via CLI
syn triggers register \
  --repo owner/my-repo \
  --event pull_request.opened \
  --workflow pr-review-v1 \
  --cooldown 60

Triggers include safety guards (concurrency, cooldown, daily limits, idempotency), condition operators for filtering events, built-in presets, and full observability: every fire and block is recorded and queryable.

Conditions

Triggers support fine-grained filtering with dot-notation field paths and comparison operators. Use conditions to whitelist specific contributors, exclude bots, filter by branch, skip draft PRs, and more. See Trigger Conditions for the full reference.

For the complete guide on triggers, conditions, guards, and observability, see Triggers.

Supported Events

Triggers can fire on any GitHub webhook event type:

  • push: commits pushed to a branch
  • pull_request.opened, pull_request.synchronize: PR activity
  • issues.labeled: issue triage
  • check_run.completed: CI results
  • workflow_run.completed: GitHub Actions completion
  • And any other GitHub webhook event

Event Delivery: Webhooks + Polling

Syntropic137 uses a hybrid approach for receiving GitHub events:

Webhooks are the primary path: real-time delivery from GitHub when your App has a reachable URL (via tunnel or public server).

Events API polling is the fallback: a background task polls GitHub's Events API on an adaptive interval. This enables zero-config onboarding without a tunnel.

Self-healing works without a tunnel. check_run events are automatically detected via Checks API polling (~30-90s latency). A tunnel provides real-time delivery (~1s) and access to additional CI/CD events (workflow_run, check_suite, etc.).

The system automatically deduplicates events using content-based keys (commit SHA, PR number, check run ID), so the same logical event is processed exactly once regardless of whether it arrived via webhook, polling, or both.

For a deep dive into the event pipeline, deduplication strategy, and polling configuration, see Event Ingestion.

Repository Installation

After creating the GitHub App, install it on your repositories:

  1. Go to your GitHub App settings → Install App
  2. Select the organization or personal account
  3. Choose All repositories or select specific ones
  4. Syntropic137 dynamically resolves installation IDs per repository, no reconfiguration needed when you add new repos

Installation tokens and transient GitHub failures

Every phase workspace gets a short-lived installation token, minted from the App with POST /app/installations/{id}/access_tokens during workspace setup. GitHub sometimes answers that call with short bursts of 5xx errors, so the mint is retried:

Token mintOther GitHub calls during provisioning
Retried onA dropped or timed-out response, 429, any 5xxA connection that dropped or timed out, 502, 503, 504
Attempts5, waiting about 5, 10, 20, 40 s (plus up to 10% jitter), or GitHub's Retry-After when sent3, with short jittered waits
Deadline3/4 of the setup phase timeout (180 s of the default 240 s), waits and requests included-
Never retried4xx other than 429 (for example 401, 403, 404, 422): GitHub's answer about the requestAny 4xx

A non-idempotent call other than the mint is sent again only when the connection was never made, so a retry can never post a second comment.

When retries run out, the phase fails with upstream kind unavailable (Upstream failure: unavailable - transient; the phase is resumable.), not auth. Resume the execution; nothing needs reconfiguring. An auth failure (401/403) still means the App's credentials or permissions need fixing.

Accepted trade-off: if GitHub minted a token but the response was lost, the retry mints another. The first is an orphan: scoped to the requested repos and permissions, live for about an hour, and not revocable by the platform because it never received it. Every resend is logged at WARNING saying an orphan may exist.

Discovering Accessible Repositories

Once the GitHub App is installed, you can list all repositories it has access to:

syn github repos
syn github repos --installation <id>    # filter by a specific installation

With --installation, this queries the GitHub API through that installation's token; without it, it reads the cached listing described below. Either way it returns repository metadata (name, owner, visibility, default branch). Use it to verify that the App can see the repos you expect before setting up trigger rules.

Listing repositories across all installations is served from a cached listing and never waits on GitHub. A listing older than 30 seconds triggers a background refresh; one older than 60 seconds is marked partial, since a repository added since may be missing. With no cached listing (first use, or just after a webhook invalidated it) the answer is empty and marked unavailable while a refresh runs, so retry shortly. No webhook or tunnel is required for this to work.

On this page