Codex CI Autofix Loop (Fix Failing GitHub Actions)
An event-triggered loop where a red GitHub Actions build invokes `codex exec` non-interactively with the failing logs and repo, and Codex proposes a fix as a PR or patch artifact — one bounded iteration per CI failure.
Implementation note
When to use: repetitive CI failures — lint drift, snapshot updates, simple breakages — where a competent first-pass fix attempt on every red build would save real triage time. How it works: a CI job triggers on workflow failure and runs codex exec non-interactively with the failing logs and the repo as context; Codex generates a fix and proposes it as a PR or a patch artifact. Because codex exec runs one task and exits, each CI failure is one bounded iteration — the event is the trigger, so there is no long-running process to babysit. Safety: the rail is stated plainly in the source guidance: configure it to propose a PR, never auto-merge — every fix must land through human review, and an auto-merge variant of this loop is unsafe. The one-shot-per-failure structure also self-limits spend. Watch the early PRs for fix quality before trusting the pattern on subtle failures.
More ci loops
Re-run PR review on schedule
Re-invoke a specific PR review skill every 20 minutes until the review completes or you stop it.
Ship specs through code review
Run spec-driven workflow loop every 10 minutes: plan work, collect reviews, execute tasks, open pull requests.
Get the build green
Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.