Skip to content

Commit 22e35eb

Browse files
andrewgazelkacodex
andauthored
AGENTS: prefer Codex review loop (#128)
## Summary - make auto-merge and the fail-fast check watcher the default PR loop - document Codex as the default review signal for agent-authored PRs - remove the repo CodeQL workflow so Codex is the code-quality lane ## Checks - nix run .#lint Co-authored-by: Codex <codex@openai.com>
1 parent d12aeb4 commit 22e35eb

3 files changed

Lines changed: 20 additions & 60 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

AGENTS.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ If the shared checkout already has unrelated edits, name the paths and the one
4141
line summary of what they appear to be doing before creating the new worktree.
4242
Avoid stashing operator work out of the way.
4343

44-
After local checks pass, push the branch and open a PR targeting `main`. Watch
45-
required checks with `gh pr checks --watch --fail-fast`; if a check fails,
46-
inspect the run logs, fix the branch, push again, and keep watching until the PR
47-
is green.
44+
After local checks pass, push the branch and open a PR targeting `main`. Enable
45+
auto-merge as soon as required checks and review state allow it. Watch required
46+
checks with `gh pr checks --watch --fail-fast`; if a check fails, inspect the
47+
run logs, fix the branch, push again, and restart the watcher. Keep that loop
48+
going until GitHub reports the PR merged or a human explicitly asks you to stop.
4849

4950
`gh pr checks` may show stale failed runs next to newer passing reruns for the
5051
same check name. When the output is mixed, inspect
@@ -55,9 +56,20 @@ list.
5556
Treat PR comments and reviews as part of the work. Read them with
5657
`gh pr view --comments` and the review fields from `gh pr view --json reviews`.
5758
Address Codex comments in code when they identify a real issue, reply when a
58-
comment is intentionally declined, and resolve review threads before enabling
59-
auto-merge. Enable auto-merge only after required checks pass and required
60-
review state is clear.
59+
comment is intentionally declined, and resolve review threads before relying on
60+
auto-merge. Codex is the default code review signal for agent-authored PRs; do
61+
not add or preserve a separate GitHub code-quality lane unless the user asks for
62+
it.
63+
64+
Codex inline feedback lives in GitHub review threads, which `gh pr view
65+
--comments` does not show. Inspect unresolved threads directly before deciding a
66+
PR is clear:
67+
68+
```sh
69+
gh api graphql \
70+
-f owner=<owner> -f repo=<repo> -F number=<pr> \
71+
-f query='query($owner:String!,$repo:String!,$number:Int!){ repository(owner:$owner,name:$repo){ pullRequest(number:$number){ reviewThreads(first:100){ nodes{ id isResolved path line comments(first:50){ nodes{ author{login} body url } } } } } } }'
72+
```
6173

6274
Unresolved Codex review threads are immediate blockers. Do not wait on more
6375
checks when Codex has left an open thread: fix the code or resolve the thread

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ One logical change per commit; see the [Workflow](AGENTS.md#workflow) section fo
8484

8585
## Pull requests
8686

87-
PRs target `main` and need one approving review plus passing status checks (`flake-check` and the `Analyze (*)` CodeQL jobs). The PR description should answer the same "why" question the commit body answers, plus anything reviewer-only (rollout plan, known follow-ups).
87+
PRs target `main` and need passing required status checks, currently `flake-check` and `chatgpt-codex-connector reviewed head`. The PR description should answer the same "why" question the commit body answers, plus anything reviewer-only (rollout plan, known follow-ups).

0 commit comments

Comments
 (0)