Repo-agnostic self-healing incident runner focused on Sentry + Codex.
Aniir now defaults to pull-based sync from Sentry so teams do not need to host incoming webhooks.
- Scheduled GitHub Action or manual run starts sync.
- Aniir pulls recent Sentry issues.
- Issues are triaged and passed to Codex for fix proposals.
- Verification runs and PRs are opened when successful.
Webhook endpoints are still available for advanced integrations, but they are optional.
npm install
npm run init -- --preset sentry-codexThis scaffolds:
aniir.config.yaml.github/workflows/aniir.yml
Then run environment checks:
npm run doctorRun a sync:
npm run sync -- --dry-runnpm run init -- --preset sentry-codexscaffolds config + workflow.npm run doctorvalidates required config and env vars.npm run syncpulls Sentry issues and processes them in batch.npm run incident -- --incident-id <id> --dry-runruns single-incident flow.npm run artifacts -- --input <incident-json-file>generates report artifacts.
SENTRY_TOKEN(or configuredsentry.api_token_env)GITHUB_TOKENfor PR creationOPENAI_API_KEYonly whenai.mode: openai_api
Optional:
SENTRY_API_HOSTfor self-hosted Sentry API base URL
Aniir uses the official @openai/codex-sdk integration.
codex_cloud_subscription(default): use Codex with ChatGPT subscription auth.codex_local_subscription: local interactive Codex subscription style.openai_api: explicit API-key mode viaOPENAI_API_KEY.
In subscription modes, Aniir does not require OPENAI_API_KEY.
- In CI (
CI=true), Aniir requiresai.mode: openai_apiby default. - To bypass this intentionally, set
ai.allow_subscription_in_ci: true. npm run doctorfails if CI mode policy is violated.
This keeps unattended runs deterministic and avoids subscription-session surprises in GitHub Actions.
run-sync applies safety checks before opening PRs:
- Skip already processed Sentry issue IDs (local sync state).
- Filter noise/insufficient-signal incidents.
- Deduplicate against known issue memory.
- Enforce verification checks before PR creation.
- Enforce
sync.max_prs_per_runlimit.
Sync state is stored at .aniir/sync-state.json by default.
Edit these values in aniir.config.yaml:
repo.idsentry.org_slugsentry.projectai.modeai.allow_subscription_in_ci(defaultfalse)prompts.*.user_instructionsfor bounded per-step custom prompt guidancesync.max_prs_per_run(default3)
Keep verification.mode: full unless you explicitly want fix_only.