feat(automode): held-PR pipeline 3b — held PR + gh-native merge detection#31
Merged
Conversation
Closes the autonomous loop: on queue drain, open one held PR auto/<id> → gits (no auto-merge) and poll GitHubCli.getPullRequest().state for merge, then mark the run complete. Decision: gh-native detection via GitHubCli (GitVcsDriver.execute is git-only), not the git patch-id cascade. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan 3b of the autonomous-toggle roadmap — closes the autonomous loop (builds on 3a, PR #29). Plan:
docs/superpowers/plans/2026-06-20-automode-held-pr-3b-pr-merge-detect.md.What this does
When the goal queue drains at roadmap end (no queued, no running, ≥1 slice landed this run), the
AutomodeDriveridle branch:auto/<integrationBranch> → gitsvia the newAutomodeHeldPrservice (idempotent: list-first, thengh pr create, nevergh pr merge).heldPrUrl/heldPrNumberin persisted run state.GitHubCli.getPullRequest().state— when GitHub reports"merged", marks the run complete (runMerged) and stops.Fail-closed: no integration branch / nothing landed → no PR; open failure → halt.
Design decision (changed from the original ask)
Merge detection is gh-native via
GitHubCli.getPullRequest().state === "merged", not the gitmerge-base/cherrypatch-id cascade. Reason discovered during implementation:GitVcsDriver.executeis git-only (can't rungh), andGitHubClialready exposes authoritative PR merge state (handles merge/squash/rebase uniformly + branch deletion). Simpler, less code, no pushed-SHA tracking. Approved at the 2026-06-20 checkpoint.New surfaces
AutomodeSnapshot.{heldPrUrl,heldPrNumber,runMerged}(back-compat decoding defaults) +AutomodeRecordHeldPrInput.recordHeldPr/markRunMerged.AutomodeHeldPrservice + layer (open_held_pr,detect_merge) overGitHubCli.v1 simplifications (documented)
One terminal run (resettable/per-project runs are Plan 7);
ghrepo derived from a completed goal'srepo(single-repo v1); base fixed togits.Verification
tsgo --force, 14/14); lint 0 errors.🤖 Generated with Claude Code