Repository navigation
fix: prepared PRs cannot refresh their target branch - #190223
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 maintainer review before merge. What this changesAllows prepared PR workspaces to integrate their verified target branch while preserving saved work and the accepted PR head. Example: A prepared PR targets integration-bot-target-1101, whose delivery-mode.txt conflicts with saved work.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a confirmed workflow refusal still present on current main; no actionable introduced defect or unresolved merge concern was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe github_publish tool dispatches Gateway actions that verify requester and publisher authority, then coordinate the canonical Git checkout and sandbox projection to return conflicts or an exact review base. flowchart TD
User[Guest request] --> Tool[GitHub publish tool]
Tool --> Gateway[Gateway action]
Gateway --> Verify[PR preparation and authority owner]
Verify --> Integration[Workspace integration owner]
Integration --> Workspace[Canonical checkout and sandbox projection]
Workspace --> Result[Conflicts or review base]
Technical reviewBest possible solution: Land the focused repair through the existing preparation and workspace integration owners while retaining source-head, authority, staging, and recovery protections. Do we have a high-confidence way to reproduce the issue? Current main contains the unconditional bound-PR refusal described in #190201, and the inspected baseline capture shows that exact error; no target code was executed during this review. Is this the best way to solve the issue? The patch addresses the owning refusal with existing verification and integration operations, preserves preparation's destination-only contract, and keeps remote-head acceptance separate from base integration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6129cfa7bebc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +46, Tests +155, Docs +13, Other +2. Total +216 across 10 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 1, 2026, 6:36 AM ET / 11:36 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: Prepared and recovered PRs can integrate their target branch and publish to the same PR after conflict resolution. |
Prepared and recovered PR workspaces can integrate their current target branch, resolve conflicts, and publish back to the same PR while preserving saved work, accepted history, and requester permissions. Fixes openclaw#190201.
Allow initial guest PR preparation from the recorded project's published history while preserving unpublished work and original PR identity. (cherry picked from commit 2757947) Stable adaptation: preserve the existing linked-identity fixture; expand its options type and allocate exactly 89 regression LF instead of 84. Production and documentation patches are unchanged from the source. Companions: #188785 is present-equivalent. Later #188784, #190223, #190576, #190542, #195413, #197229, #197243, #199717, #195787, #197510, #193664, #199851, #199864, #197656, #198851, #193873, #197594, #189006, #188904, #194025, #196200, #192283, #189010, #188816 and e0466ff are not prerequisites to this scoped repair; retain their separate intake dispositions. No later PR-number mentions. Proof: baseline 4 failed/20 passed through registered agent action; fixed 41/41 across preparation, refresh and base-action suites. Type-aware lint4, formatting5, docs MDX1419 and diff check pass. No live GitHub or full release qualification claim. Co-authored-by: RomneyDa <[email protected]>
Backport #190223 (5cac93c) without newer origin metadata or maintainer-impersonation test fixtures. Preserve accepted PR heads, guest work, authority checks, and pending conflict recovery. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 54bcfd7333d40c3c9d72568a0e08ccb6bf339a4c)
Fixes #190201.
What Problem This Solves
A guest who recovered an existing PR with
prepare_prcould publish further changes, then become unable to integrate the target branch.refresh_baserejected every associated PR and redirected back to preparation, which updates PR source and review comparison without merging destination-only changes.User Impact
Prepared and recovered PRs can integrate their current target branch, resolve conflicts, and continue publishing to the original PR. Saved guest files and Git history remain intact. Distinct staged and unstaged versions are preserved by refusing the refresh until the staged work is committed; existing requester permissions and changed-remote-head publication checks remain in effect.
Why This Change Was Made
Bound base refresh now uses the existing PR preparation owner to verify the current requester, publisher, PR identity, and target, then passes that verified base to the existing workspace integration owner. It keeps accepted PR-head metadata separate from the target being merged. Pending head preparation and pending base integration remain separate operations, and a retry finishes its accepted base before selecting another target.
A previous publication still identifies the accepted head after the PR is retargeted; it is matched by its original head branch rather than its former target branch. Review comparison follows the integrated host history, so repeating preparation does not discard a completed base merge from the comparison. No configuration, schema, or public action parameters are added.
Evidence
The registered-action regression first reproduced the original refusal after outside head advancement, successful preparation, and same-PR publication, with both linked and unlinked guests. Production source was unchanged for that run; both cases failed at the bound-PR guard.
The corrected registered-action flow now recovers another writer's head, publishes, retargets the PR to a conflicting base, preserves distinct staged work, recovers an interrupted transfer, resolves conflicts, and publishes directly to the same PR. It proves both previous PR history and the selected target remain ancestors, then repeats preparation to check the review comparison. Existing fork, maintainer/guest, remote-head rejection, and prefix-stability controls passed alongside it.
ee73c0e5de4. Autoreview is scoped-clean for P0–P2 on the complete implementation range726a4da0fb5..d797c14276fand separately on the final test-only supplement; the unchanged production review is reused.pnpm buildpassed on implementation treed797c14276f, including runtime and Control UI output, in 2 minutes 33.9 seconds.ee73c0e5de4: 61 checks passed, 55 were intentionally skipped, and none were failing, pending, or missing. The earlier implementation head also passed its 14 selected Node rows and related UI/build/type/security gates.Live GitHub flow
Both a conversation-published PR and a genuine guest-authored fork PR reproduced the baseline refusal, then completed the corrected flow in the same retained sessions: outside-head recovery, publication, actual target retargeting to a conflicting base, refresh, resolution, native checks, and direct publication back to the original PR without another
prepare_pr. Original PR/head branches, authors, title/body, outside contributions, saved tracking work, and base-only content were preserved. Both final heads contain their prior publication and integrated target as ancestors.The current admin subsequently merged both disposable demo PRs: session publication and external fork. A returning guest after admin inspection was denied
operator.write. Each real sandbox passed its three fixture checks and exact working/index/diff assertions. Each bound autoreview completed scoped-clean at its default P0-only scope after publication; these are separate from this source PR's engineering review.The runtime used the exact production source tree of
d797c14276fthrough a verified native build carrier. Final headee73c0e5de4adds only authorization tests and their test-line budget; production/runtime/UI files and dependencies are identical. The live run and media retain their actuald797c14276f/681513d48b3identities and are reused without replay. Before/after captures show the same prepared PR and retargeted base. The recording shows reaching the conflict result; native receipts and live GitHub ancestry/content checks establish the later resolution, publication, and admin completion. The external acknowledgement wrapper timed out after dispatch, but its retained nested result and filesystem state proved completion, so it was not retried. No access, model, isolation, or timeout override was used.Visual evidence
External fork PR: sanitized native request-to-conflict recording
external-after-refresh.mp4
Visual verification
d797c14276f3327227e13556557cc58f88db9c71