fix(gh): allow protected auto-merge requests - #179
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 21, 2026, 11:55 AM ET / 15:55 UTC. ClawSweeper reviewWhat this changesAllows protected squash auto-merge requests through native GitHub CLI using an explicit head SHA, rewritten subject, and private body snapshot, with diagnostic tests and documentation. Merge readiness⛔ Blocked before merge - 5 items remain The capability remains absent from main, but the new queue path bypasses the promised commit-text protection. Real behavior proof is also required before merge. Priority: P2 Review scores
Verification
How this fits togetherOctopool wraps GitHub CLI and checks outgoing publication text against rewrite rules before dispatching writes using the caller’s credentials. This change delegates eligible merge requests to GitHub’s immediate or deferred merge lifecycle. flowchart TD
A[Merge request and text] --> B[Final rewrite policy]
B --> C[Validate and sanitize]
C --> D[Private body snapshot]
D --> E[Native GitHub CLI]
E --> F[Immediate or deferred merge]
F --> G[Published commit metadata]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Deferred queue publication can bypass the active commit-text rewrite boundary; no unrelated supply-chain changes were found. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Support deferred merges only where sanitized commit metadata remains authoritative, retaining refusal for queue behavior that cannot uphold publication protection. Do we have a high-confidence way to reproduce the issue? Yes, at source level: main explicitly rejects protected --auto requests, and the proposed queue route passes sanitized fields that GitHub’s documented API ignores. No live merge was executed during this read-only review. Is this the best way to solve the issue? No. Reusing the existing sanitizer and snapshots is appropriate, but native queue delegation does not preserve their effect on published metadata. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found, but no applicable review policy affected this item. Codex review notes: model internal, reasoning medium; reviewed against 59aaed9fef09. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Problem
Protected
gh pr merge --autorequests are rejected before GitHub CLI starts, preventing maintainer workflows from handing required-check waiting to GitHub.Change
Allow only numeric, exact-head squash auto-merge requests with an explicit nonempty subject and body file/stdin. Both fields pass the active rewrite policy; the native child receives sanitized text and a private immutable body snapshot with empty stdin. Immediate merges retain their existing REST path. Admin, non-squash, unpinned, ambiguous, and implicit-publication requests remain blocked.
The head check is a submission-time precondition; GitHub owns later auto-merge/queue behavior. Existing opt-in diagnostics distinguish a local no-child refusal from an uncertain child outcome, without changing native exit codes or weakening publication protection.
Validation
go test ./...: passed, 153.93 s wall;go vet ./...passed.Related: openclaw/openclaw#154673.