Repository navigation
fix: continue imported PRs after destination changes - #186451
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 changesThis PR lets explicit imported-PR preparation reconcile a changed destination and review comparison while preserving saved work. Example: An imported PR changes destination from main to test/pr-destination-base-20261028 after the guest saves commit 1a1f8b1 and an uncommitted README edit.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides useful continuation behavior that current main still refuses, with no actionable introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway prepares an owned GitHub PR in a session-managed workspace, records its accepted source and destination, and supplies an exact review base for subsequent publication. flowchart TD
A[Guest continuation request] --> B[GitHub preparation action]
B --> C[Current identity and PR checks]
C --> D[Existing workspace integration owner]
D --> E[Sandbox review comparison]
E --> F[Accepted session PR binding]
F --> G[Existing publication checks]
Technical reviewBest possible solution: Reconcile explicit destination refreshes through the existing preparation and review owners while retaining publication identity and write-access checks. Do we have a high-confidence way to reproduce the issue? Current main directly shows the refusal, corroborated by the supplied baseline screenshot and registered-action regression; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch addresses the full continuation path rather than deleting the refusal alone: it refreshes the comparison, preserves accepted recovery state, and avoids restaging destination-only changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d5016796673c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +38, Tests +55, Docs +5. Total +98 across 7 files. Added test files: 0. View PR surface stats
LabelsLabel 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 HistoryReview history (1 earlier review cycle)
Reviewed October 28, 2026, 12:02 AM ET / 04:02 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: guests can continue the same imported PR after its destination changes while preserving local work and history. |
Allow guests to continue the same imported PR after its destination changes while preserving local edits, staging and history. Fixes openclaw#186442.
Fixes #186442.
What Problem This Solves
A guest continuing an imported PR cannot refresh it after the author changes its destination branch: preparation tells the author to restore the old base. The existing refusal prevents a stale successful result, but leaves ordinary contribution work blocked even when the PR and head branch are unchanged and the guest remains authorized.
User Impact
Explicit preparation reconciles the PR's current destination and exact review comparison. A destination-only refresh preserves the guest's staged and unstaged edits, files, commits and branch history; it does not merge the destination into the PR head or change the destination on GitHub. Publication continues to use the same PR and head branch under the existing identity and write-access checks.
If remote source work must also be integrated, the existing conflict-resolution path remains responsible for it. An interrupted refresh keeps its accepted source head while updating the destination used for review. The tool guidance directs the agent to reconcile recoverable changes from the user's intent and ask a focused question for a material ambiguity.
Why This Change Was Made
The existing PR binding already owns the destination consumed by publication and metadata actions. Preparation now updates that binding together with its review comparison instead of requiring a reversal on GitHub. The unchanged-head path selects only a review base, avoiding file synchronization and staging. Review installation completes before a finished source adopts the new destination, so a failed review remains retryable.
Publication's strict live-target checks remain in place. No schema, permission, public tool argument or external retarget operation is added. The source integration and review owners retain their existing responsibilities.
Evidence
The new registered-action regression fails on unchanged production at
8f2190bb63cc8ff1cafceffbf1bb429232c1ad5dwith the restore-old-base error. It imports real Git source, saves guest commit history and distinct staged/working bytes, changes the destination, and checks the comparison and preserved state. Existing same-repository, fork and interrupted-conflict cases cover continuation with the new destination.Changed-file formatting/lint and all ten selected type-check aggregates passed. There are 158 qualified focused tests across ten files: 111 Gateway cases, eight prompt-prefix checks, and 39 tool/handoff checks. The Gateway batch took 201.54 seconds; the affected prompt/tool retry took 84.86 seconds. The first description check caught refresh guidance being offered before managed adoption; that guidance is now scoped to the existing capability. All selected hosted CI jobs passed on
1b6532ba471c3e86304c89f9dfbbc379a81f816f.Live guest continuation
An ordinary guest continued an owned test PR with a meaningful README documentation task, saved a local commit, and made an uncommitted follow-up edit. The actual PR author then changed only its destination. On the baseline, the agent preserved the work but could not publish without restoring the old base. After updating only the isolated preview to the exact fixed head, a natural retry in the same saved conversation reconciled the destination and review comparison, passed all 30 repository tests, and published to the same PR and original head branch. A normal read-only status follow-up confirmed completion.
Native publication receipts and GitHub readback verified that the appended commit has the original head as its single parent, the chosen destination remains selected, and the title, body, author and draft state are unchanged. Published README bytes match the saved local content. The guest's HEAD, branch, index, staged files and uncommitted edit remained intact; the intended review ref changed. Current guest scopes remained limited to session read/write, and a harmless privileged read-only inspection was denied.
The live case uses one private same-repository fixture with synthetic post-login ingress and the existing trusted-host Code Mode boundary. It does not claim production sign-in or hostile-code isolation. No conflict arose from the base-only retarget; newer-head conflicts, interruption, forks and revocation are covered by the registered-action tests. Independent engineering review and canonical Auto Review are clean. The matched captures and 69-second recording below show the actual natural conversation; private UI details are redacted. The clip joins the initial continuation to a later read-only confirmation; the intervening wait and status-check work are omitted, and the transition is labelled.
Visual evidence
Natural continuation and read-only completion confirmation; idle interval omitted and labelled
proof.mp4
Visual verification
1b6532ba471c3e86304c89f9dfbbc379a81f816f