Babysit open PRs with Codex CI fixes and guarded rebases #315
- MA
Open PRs currently need manual rebases and CI repairs. This adds a Codex workflow using **GPT-6.1 Sol at low reasoning effort** that investigates current-commit CI failures and proposes small verified fixes on the existing PR branch, plus a separate workflow that rebases open PRs onto `main` through GitHub's guarded API.
Fixes run hourly and after failed `ci` runs; rebases run after `main` changes and every four hours. Both share a queue, preserve drafts, skip forks and `no-babysit` PRs, and leave merging to humans. The fixer handles up to three PRs per run and stops changing a branch after two consecutive fix commits. Uncertain fixes and conflicts receive a comment.
### Workflow

### Setup
Both repository secrets are present: `CODEX_API_KEY` and `PR_MAITENANCE_TOKEN` (using its existing spelling). The GitHub token needs **Contents** and **Pull requests** read/write permissions for this repository. It allows branch updates to trigger normal PR CI. Merge this PR to activate the workflows.
### Validation
- 15 maintenance tests pass, including branch races, conflicts, pagination, and bounded attempts. - `gh aw compile pr-ci-fix --strict --validate` passes. Its unrestricted PR-target warning is intentional: the requested scope is all open PRs, with eligibility checked before work. - `bun run ci` passes; native workflow YAML parses successfully. All 52 generated shell scripts pass `bash -n`, and the Sol model and low-effort override are present. - Full repository suite: 3,734 pass, 3 skip, zero failures. PostgreSQL-only tests require `TEST_DATABASE_URL`.
<details> <summary>Compiler security review</summary>
Reviewed new secrets: `CODEX_API_KEY` and its optional `OPENAI_API_KEY` alias authenticate the Codex engine through gh-aw's credential-isolating proxy. `PR_MAITENANCE_TOKEN` is used by trusted credential validation, native rebasing, and safe-output application; it is excluded from the agent's execution environment. No secrets were removed and no redirects changed.
Reviewed SHA-pinned actions: `actions/checkout`, `actions/setup-node`, `actions/github-script`, `actions/upload-artifact`, `actions/download-artifact`, `actions/cache/restore`, `actions/cache/save`, `oven-sh/setup-bun`, and the existing `github/gh-aw-actions/setup@v0.86.2`. These provide checkout, runtimes, framework handlers, and artifacts/caches. The generated agent has read-only GitHub permissions; guarded writes use a separate job. File allowlists block workflow, instruction, manifest, lockfile, and maintenance-script edits. Threat detection fails closed.
The GitHub PAT's organization approval and permissions must be checked when it is provisioned. Live automated pushes and rebases have not been run before human review.
</details>
MaggieAppletonmerged a6e57e6dd367last month on GitHub
MaggieAppletonhead-ref-deletedlast month on GitHub