Skip to content

fix: continue imported PRs after destination changes - #186451

Merged
shakkernerd merged 1 commit into
mainfrom
guest-pr-destination-continuation
Oct 28, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
guest-pr-destination-continuation

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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 8f2190bb63cc8ff1cafceffbf1bb429232c1ad5d with 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

Open preview

Before After
Baseline preserves saved work but refuses continuation until the old destination is restored. Fixed build confirms publication to the same PR with its new destination and saved local work intact.

Natural continuation and read-only completion confirmation; idle interval omitted and labelled

proof.mp4

Visual verification

  • Baseline: 8f2190b
  • Exact head: 1b6532ba471c3e86304c89f9dfbbc379a81f816f
  • Scenario: An ordinary guest continues a README contribution, preserves local work after the author changes the destination, and updates the same PR. A read-only follow-up confirms publication.
  • Runtime/build: Before: 2026.10.8-8f2190bb63cc-2026-10-28T02-06-13.760Z. After: 2026.10.8-1b6532ba471c-2026-10-28T02-57-45.316Z. Same saved guest conversation, native OpenClaw runtime.
  • Destination and target: Same PR and head branch; author-selected destination retained.
  • Published history: New published commit has the original PR head as its single parent.
  • Saved work: Guest HEAD, branch, index and file hashes preserved; only the intended review ref changed.
  • Authority: Guest session read/write scopes retained; privileged read-only inspection returned FORBIDDEN.
  • Exact before/after runtime build identities verified through native hello and owner records.
  • Ordinary human prompts; internal actions and assertions stayed in the harness.
  • Native published receipt and GitHub parent/destination/file readback independently confirmed completion.
  • Private model/footer fields and a private repository notification are redacted; primary result text is unchanged.
  • The same conversation has extra normal continuation/status turns after update; no layout or latency claim.
  • Original recordings are retained through assessment; the 69-second clip labels its omitted idle interval.

@shakkernerd shakkernerd self-assigned this Oct 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 28, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Preparation requires restoring main before continuation.
  • After: Preparation accepts the selected destination, preserves local work, and permits publication to the same PR and head branch.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-directed change with inspected shipped-flow evidence, meaningful state-preservation coverage, passing reviewed-head checks and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots and the supplied exact-head live verification describe an ordinary guest continuing the same saved conversation, adopting the changed destination and publishing preserved README work to the original PR; this addresses the previous review's pending live-proof request.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Guests must undo an intentional PR destination change before continuing their saved contribution.
Reason: The maintainer-authored direction removes a concrete workflow restriction using existing owners without adding configuration, permissions or public arguments.

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
Reviewed head: 1b6532ba471c3e86304c89f9dfbbc379a81f816f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Destination-change refusal and accompanying guidance changes intended behavior with a stated reason (56dfbbe: Prevent preparation from reporting success with an obsolete review destination while publication still requires the recorded target.)
  • Accepted-head recovery and staged-work preservation keeps the original intent (13c8407: Resume the already accepted source after interruption and preserve guest history and index-only content during newer-head integration.)
  • Review-base installation and authorized snapshot transport keeps the original intent (9218dca: Give imported source an exact comparison without merging newer destination files or allowing arbitrary guest-selected host donors.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still refuses destination changes: The fetched main revision explicitly rejects a changed base branch before same-head reuse or source integration. (src/gateway/github-pr-workspace-preparation.ts:266, d5016796673c)
  • Complete reconciliation through existing owners: The introduced changes update destination observations, preserve an interrupted operation's accepted head, and install a destination-only review comparison before accepting its binding. (src/gateway/github-pr-workspace-preparation.ts:324, 1b6532ba471c)
  • Saved-work regression coverage: The registered-action regression uses real Git state and checks distinct staged and working bytes, untracked work, local history, advancing destination tips, and the exact review reference. (src/gateway/github-pr-workspace-preparation.test.ts:200, 1b6532ba471c)
  • Publication boundary retained: Publication still checks the live PR against the accepted repository, destination and head branch, while write preflight verifies current PR and branch eligibility. (src/gateway/github-publication-target.ts:29, 1b6532ba471c)
  • Inspected live continuation screenshots: The supplied before screenshot shows refusal with saved work intact; the after screenshot shows same-PR publication at commit 2c2990d with the selected destination, local commit and pending edit retained. Both downloaded images were inspected directly. (1b6532ba471c)
  • Video inspection infrastructure limit: The prepared manifest reports “ffprobe failed: spawnSync ffprobe ENOENT”; browser fallback returned a cache miss. This does not invalidate the separately inspected screenshots. (1b6532ba471c)

Likely related people:

  • Shakker: Raw commit 9218dca adds src/gateway/github-publication-workspace-review.ts:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9218dca35cbf; files: src/gateway/github-publication-workspace-review.ts)
  • Peter Steinberger: Raw commit 484419f adds src/gateway/github-pr-workspace-preparation.ts:268 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 484419f1a36d; files: src/gateway/github-pr-workspace-preparation.ts)

PR surface

Source +38, Tests +55, Docs +5. Total +98 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 63 25 +38
Tests 2 59 4 +55
Docs 1 10 5 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 132 34 +98

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: A bounded contribution workflow is blocked after a legitimate destination change, while saved work remains intact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-28T02:45:06.416Z sha 1b6532b :: needs maintainer review before merge. :: none

Reviewed October 28, 2026, 12:02 AM ET / 04:02 UTC (Revision 2).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@shakkernerd
shakkernerd merged commit 18e94f2 into main Oct 28, 2026
177 checks passed
@shakkernerd
shakkernerd deleted the guest-pr-destination-continuation branch October 28, 2026 04:38
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: guests can continue the same imported PR after its destination changes while preserving local work and history.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
Allow guests to continue the same imported PR after its destination changes while preserving local edits, staging and history.

Fixes openclaw#186442.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: imported PR continuation requires undoing a destination change

1 participant