🤖 fix: make PR readiness waiting fail fast#10
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
6562320 to
2974392
Compare
|
@codex review Please take another look after the rebase and CI rerun. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2974392993
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the fail-fast concern in |
Add --once status contract to wait_pr_codex.sh and wait_pr_checks.sh, then refactor wait_pr_ready.sh to poll both gates in one loop and exit on first terminal failure. Update AGENTS.md to document the single-command readiness flow. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.26`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.26 -->
Update wait_pr_ready.sh to exit immediately when wait_pr_codex.sh --once returns a terminal failure, instead of always invoking wait_pr_checks.sh first. This preserves true fail-fast behavior and avoids unnecessary delay when Codex has already produced actionable feedback. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.26`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.26 -->
7e3acb1 to
4999651
Compare
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Refactor the PR readiness waiting flow so it evaluates Codex and CI checks concurrently with fail-fast behavior.
Background
The previous readiness flow waited on Codex first and only then waited on checks, which delayed feedback when CI failed early.
Implementation
--oncemode toscripts/wait_pr_codex.shandscripts/wait_pr_checks.shwith a shared status contract:0= passed10= still waiting1= terminal failurescripts/wait_pr_ready.shinto a coordinator loop that:AGENTS.mdPR loop documentation to use./scripts/wait_pr_ready.sh <pr_number>as the unified wait step.Validation
make verify-vendormake testmake buildbash -n scripts/wait_pr_ready.shbash -n scripts/wait_pr_codex.shbash -n scripts/wait_pr_checks.shRisks
Low-to-moderate risk in shell control flow. Changes are localized to PR helper scripts and include defensive assertions for unexpected state/status values.
📋 Implementation Plan
Plan: unify PR readiness waiting into fail-fast concurrent checks
Context / Why
The current PR wait flow is sequential:
wait_pr_ready.shwaits for Codex first, then waits for CI checks. This delays feedback when CI fails early, because the script can block on Codex response first.Goal: make
wait_pr_ready.sha single command that evaluates Codex + CI in the same polling loop, exits immediately on the first terminal failure, and only succeeds when both gates are green.Evidence
scripts/wait_pr_ready.shcurrently runs phases in order (wait_pr_codex.shthenwait_pr_checks.sh, lines 46–70).scripts/wait_pr_codex.shandscripts/wait_pr_checks.sheach have their ownwhile truepolling loops and terminal exits.AGENTS.mdcurrently documents a split workflow (wait_pr_codex.shthenwait_pr_checks.sh, lines 99–106), so docs must be aligned with the new behavior.Implementation details
Add a single-iteration mode to both wait scripts (reusable status contract).
scripts/wait_pr_codex.sh,scripts/wait_pr_checks.sh.--oncemode that performs one status evaluation and exits with:0= gate passed10= still waiting/pending1= terminal failure (needs user action)Refactor
wait_pr_ready.shinto a true combined coordinator loop.scripts/wait_pr_ready.sh.--oncemode each tick.1; succeed only when both return0; otherwise continue when either is10.Keep script responsibilities explicit and non-duplicative.
wait_pr_codex.shremains the source of truth for:@codex reviewrequest detection,check_codex_comments.sh.wait_pr_checks.shremains source of truth for:gh pr checksstatus,wait_pr_ready.sh) should orchestrate only, not re-implement these internals.Update workflow documentation to match new single-command flow.
AGENTS.md../scripts/wait_pr_ready.sh <pr_number>(remove explicit split steps for Codex then checks).Validation plan after implementation.
bash -n scripts/wait_pr_ready.shbash -n scripts/wait_pr_codex.shbash -n scripts/wait_pr_checks.sh<missing pr_number>cases).Why this approach (brief)
wait -n, trap/kill coordination, interleaved output).0/10/1contract makes control flow deterministic and easy to assert.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.26