Skip to content

fix: handle GitHub's clean auto-merge refusal - #249

Merged
kixelated merged 5 commits into
mainfrom
quest/m0/helpers/merge-state-race
Oct 28, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m0/helpers/merge-state-race

Conversation

@kixelated

@kixelated kixelated commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

When GitHub still reports UNKNOWN, both landing paths enable auto-merge. If GitHub computes the merge state before handling that mutation, it can refuse with “Pull request is in clean status” even though the PR is ready to merge.

On that specific refusal, reread once and merge only if the new state is CLEAN, HAS_HOOKS, or UNSTABLE. Both attempts stay pinned to the original head. Revalidate the hold and head and refuse a newly gated or queued base; preserve other refusals and never poll or try an immediate merge first. Existing quest land and merge-queue paths stay on auto-merge.

Share the GitHub-specific state/refusal decisions in src/github/merge.ts, outside the tracker-independent core. Remove the completed quest and its epic link; labels on merged PRs remain unchanged.

Validation: just check, just test, quest check --base origin/main, and focused CLI/Worker regression tests passed. Coverage includes the clean-state race, accepted UNKNOWN auto-merge, unchanged unrelated/still-unknown refusals, and changes to the head, hold, gate, or queue during the refusal.

(written by GPT-6)

@kixelated kixelated changed the title Land through a merge state GitHub is still computing fix: handle GitHub's clean auto-merge refusal Oct 28, 2026
@kixelated
kixelated marked this pull request as ready for review October 28, 2026 05:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T16:47:40.557457Z 20dc58e New commits
🔒 Security Review ✅ Completed 2026-10-28T16:49:14.184164Z 20dc58e New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed commit: 42ab05c

No actionable bugs found in the changed areas. The direction is sound: a single reread after the specific clean-status refusal is simpler and safer than polling or attempting an immediate merge first. Both CLI and Worker keep the original head pinned, revalidate the hold, and reject newly gated or queued landing paths; the small shared GitHub helper avoids duplicating those decisions without expanding the core API.

Verification: static inspection of both landing paths, their surrounding hold/error/gate handling, and the added regression tests. I did not execute tests or exercise live GitHub merge behavior; the PR's reported test results were not independently verified.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging via /quest-merge, picked by the user in /quest-complete.

  • Head 42ab05c57dcf2f67f0e30119c59ac1d63ea540ea: 16/16 checks passed; merge state clean; quest check --base origin/main --branch quest/m0/helpers/merge-state-race ok (59 documents, main at 93a5d47).
  • Qualifying review: Codex code and security reviews completed on this head with no findings (👍). The OpenAI review from the author's account is advisory and also found no actionable bugs.
  • No changes or decisions made during merge. Landing through quest land (squash).

(written by Claude Opus 5.5)

…e-state-race

# Conflicts:
#	quest/m0/helpers/merge-state-race.md
…e-state-race

# Conflicts:
#	cloudflare/src/github/service.ts
#	src/cli/hold.ts
@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing via /quest-merge (resumed), picked by the user in /quest-complete.

(written by Claude Opus 5.5)

@kixelated
kixelated merged commit f427a2f into main Oct 28, 2026
9 of 11 checks passed
@kixelated
kixelated deleted the quest/m0/helpers/merge-state-race branch October 28, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant