Skip to content

docs(agents): draft-then-ready PR creation prevents the merge-ref CI race#110970

Merged
steipete merged 1 commit into
mainfrom
claude/agents-draft-ready-tip
Jul 18, 2026
Merged

docs(agents): draft-then-ready PR creation prevents the merge-ref CI race#110970
steipete merged 1 commit into
mainfrom
claude/agents-draft-ready-tip

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The AGENTS.md note from #110812 documents the dropped PR-open CI race and its manual remedy, but not the validated prevention or the now-landed automated repair (#110889/#110945).

Why This Change Was Made

Draft-then-ready was validated twice this week: creating the PR as a draft, polling mergeable until non-null, then marking ready makes CI attach first try (ready_for_review is in ci.yml's trigger types and the draft preflight skips cheaply). The sweeper reference tells agents the self-heal path exists before they reach for manual close/reopen.

User Impact

Agent-workflow guidance only; no runtime changes.

Evidence

Docs-only: git diff --check clean. This PR is itself created non-draft immediately after push, deliberately racing the merge ref as a live test of the sweeper's repair path.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe1994f832

ℹ️ 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".

Comment thread AGENTS.md
- GH comments with backticks, `$`, or shell snippets: use heredoc/body file, not inline double-quoted `--body`.
- PR create: real body required. Use the current template: `What Problem This Solves`, `Why This Change Was Made`, `User Impact`, and `Evidence`; include visible refs, behavior, and validation.
- PR create races GitHub's merge-ref computation: the pull_request-open CI run can drop entirely or die as `startup_failure`/`BuildFailed` (`(Unknown event)`, not rerunnable). After opening, verify the CI workflow attached to the head SHA; if missing, close/reopen the PR to re-fire the event.
- PR create races GitHub's merge-ref computation: the pull_request-open CI run can drop entirely or die as `startup_failure`/`BuildFailed` (`(Unknown event)`, not rerunnable). Prevention: `gh pr create --draft`, poll `mergeable` non-null, then `gh pr ready`. After opening, verify the CI workflow attached to the head SHA; if missing, the hourly `pr-ci-sweeper` re-fires it, or close/reopen manually.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Define the poll against the REST mergeable value

An agent following this guidance is likely to use gh pr view --json mergeable, but that command exposes GraphQL's non-null MergeableState enum (MERGEABLE, CONFLICTING, or UNKNOWN), not the REST API's nullable boolean (GitHub contract). During the merge-ref race it therefore returns the non-null value UNKNOWN, so a literal “poll until non-null” completes immediately and gh pr ready can reintroduce the dropped-CI race this line is intended to prevent. Specify an exact REST gh api poll for .mergeable != null, or tell GraphQL users to wait until the value is not UNKNOWN.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit fa9ae68 into main Jul 18, 2026
63 of 65 checks passed
@steipete
steipete deleted the claude/agents-draft-ready-tip branch July 18, 2026 21:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant