mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[codex] Clarify PR babysitter state mutations (#27038)
# Why Codex is doing a bit too much on my PRs that it's babysitting. In particular I'd like it to not interact with comment threads that involve other humans -- I should be the one doing human interaction. This is tricky because it's still very useful to be able to drop review comments myself and have Codex iterate on them. ## What This updates `.codex/skills/babysit-pr/SKILL.md` with an explicit GitHub state mutation policy.
This commit is contained in:
committed by
GitHub
Unverified
parent
9e0d7f02c9
commit
f3a8074975
@@ -29,7 +29,7 @@ Accept any of the following:
|
||||
4. If `diagnose_ci_failure` is present, inspect failed run logs and classify the failure.
|
||||
5. If the failure is likely caused by the current branch, patch code locally, commit, and push. Do not patch random flaky tests, CI infrastructure, dependency outages, runner issues, or other failures that are unrelated to the branch.
|
||||
6. If `process_review_comment` is present, inspect surfaced review items and decide whether to address them.
|
||||
7. If a review item is actionable and correct, patch code locally, commit, push, and then mark the associated review thread/comment as resolved once the fix is on GitHub.
|
||||
7. If a review item is actionable and correct, patch code locally, commit, push, and then resolve the associated review thread only when allowed by the GitHub state mutation policy below.
|
||||
8. Do not post replies to human-authored review comments/threads unless the user explicitly confirms the exact response. If a human review item is non-actionable, already addressed, or not valid, surface the item and recommended response to the user instead of replying on GitHub.
|
||||
9. If the failure is likely flaky/unrelated and `retry_failed_checks` is present, rerun failed jobs with `--retry-failed-now`.
|
||||
10. If both actionable review feedback and `retry_failed_checks` are present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change.
|
||||
@@ -101,7 +101,7 @@ When you agree with a comment and it is actionable:
|
||||
1. Patch code locally.
|
||||
2. Commit with `codex: address PR review feedback (#<n>)`.
|
||||
3. Push to the PR head branch.
|
||||
4. After the push succeeds, mark the associated GitHub review thread/comment as resolved.
|
||||
4. After the push succeeds, resolve the associated GitHub review thread only when allowed by the GitHub state mutation policy below.
|
||||
5. Resume watching on the new SHA immediately (do not stop after reporting the push).
|
||||
6. If monitoring was running in `--watch` mode, restart `--watch` immediately after the push in the same turn; do not wait for the user to ask again.
|
||||
|
||||
@@ -109,6 +109,31 @@ Do not post replies to human-authored GitHub review comments/threads automatical
|
||||
If the watcher later surfaces your own approved reply because the authenticated operator is treated as a trusted review author, treat that self-authored item as already handled and do not reply again.
|
||||
If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new unresolved follow-up feedback appears.
|
||||
|
||||
## GitHub State Mutation Policy
|
||||
|
||||
You can read any PR state you need for monitoring. Writes must comply with this policy.
|
||||
|
||||
You can push PRs to update the code under review or to force CI re-runs as described above.
|
||||
|
||||
You can resolve review comment threads from the human who requested babysitting or from the Codex
|
||||
review bot. When resolving, leave a comment prefixed with `[from Codex]: ` and explain what changes
|
||||
you made and which commit includes them. Don't touch review threads if other humans other than the
|
||||
user who requested babysitting have participated.
|
||||
|
||||
Before making any changes, fetch the PR state yourself instead of relying on the PR watcher script's
|
||||
output.
|
||||
|
||||
Unless explicitly asked, do not:
|
||||
|
||||
* comment on other humans' review threads, communicate with the user in chat instead
|
||||
* resolve review threads from humans other than the user
|
||||
* interact with humans other than the user
|
||||
* mark PRs as drafts or ready for review
|
||||
* close or reopen PRs
|
||||
|
||||
In general, never act on GitHub in ways that would make it hard to tell whether you or the user did
|
||||
something visible to other humans. When in doubt, ask the user for clarification in chat.
|
||||
|
||||
## Git Safety Rules
|
||||
|
||||
- Work only on the PR head branch.
|
||||
@@ -133,10 +158,10 @@ Use this loop in a live Codex session:
|
||||
3. First check whether the PR is now merged or otherwise closed; if so, report that terminal state and stop polling immediately.
|
||||
4. Check CI summary, new review items, and mergeability/conflict status.
|
||||
5. Diagnose CI failures and classify branch-related vs flaky/unrelated. If the overall run is still pending but `failed_jobs` already includes a failed job, fetch that job's logs and diagnose immediately instead of waiting for the whole workflow run to finish. Patch only when the failure is branch-related.
|
||||
6. For each surfaced review item from another author, patch/commit/push and then resolve it if it is actionable. If it is non-actionable, already addressed, or requires a written answer, surface it to the user with a suggested response instead of posting automatically. If a later snapshot surfaces your own approved reply, treat it as informational and continue without responding again.
|
||||
6. For each surfaced review item from another author, patch/commit/push if it is actionable, then resolve it only when allowed by the GitHub state mutation policy above. If it is non-actionable, already addressed, or requires a written answer, surface it to the user with a suggested response instead of posting automatically. If a later snapshot surfaces your own approved reply, treat it as informational and continue without responding again.
|
||||
7. Process actionable review comments before flaky reruns when both are present; if a review fix requires a commit, push it and skip rerunning failed checks on the old SHA.
|
||||
8. Retry failed checks only when `retry_failed_checks` is present and you are not about to replace the current SHA with a review/CI fix commit. Do not make code changes for unrelated flakes or infrastructure failures just to get CI green.
|
||||
9. If you pushed a commit, resolved a review thread, or triggered a rerun, report the action briefly and continue polling (do not stop). If a human review comment needs a written GitHub response, stop and ask for confirmation before posting.
|
||||
9. If you pushed a commit, resolved an eligible review thread, or triggered a rerun, report the action briefly and continue polling (do not stop). If a human review comment needs a written GitHub response, stop and ask for confirmation before posting.
|
||||
10. After a review-fix push, proactively restart continuous monitoring (`--watch`) in the same turn unless a strict stop condition has already been reached.
|
||||
11. If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report that the PR is currently ready to merge but keep the watcher running so new review comments are surfaced quickly while the PR remains open.
|
||||
12. If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker and stop.
|
||||
|
||||
Reference in New Issue
Block a user