Repository navigation
fix: prepare guest PRs from newer published project bases - #188790
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 changesAllow a clean managed workspace to prepare an older PR when its HEAD belongs to the original project's published source branch. Example: A guest prepares an older PR from a clean workspace five published main commits beyond the PR's recorded base.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current preparation bug with a focused change in the existing integration owner; no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway's GitHub preparation action verifies the requester and PR, then asks the managed workspace integration owner to install the accepted source into the canonical checkout and sandbox projection. flowchart TD
A[Guest preparation request] --> B[Requester and PR verification]
B --> C[Original project identity]
C --> D[Workspace integration owner]
D --> E[Authenticated published branch]
E --> F[Clean workspace ancestry check]
F --> G[Canonical checkout and sandbox projection]
Technical reviewBest possible solution: Keep publication detection in the existing integration owner, verifying the original project's recorded branch while retaining all clean-workspace and requester checks. Do we have a high-confidence way to reproduce the issue? Current-main ancestry checks establish the failing graph, and the linked report and supplied baseline screenshot corroborate the refusal; no target code was executed during this review. Is this the best way to solve the issue? This is a focused repair of publication detection using existing repository identity, branch parsing, authenticated transport, and integration ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8034bb1fafbe. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +41, Tests +84, Docs +3, Other +2. Total +130 across 6 files. Added test files: 0. View PR surface stats
Review metrics
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 30, 2026, 8:25 PM ET / October 31, 2026, 00:25 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: guests can prepare older PRs from newer published project history while preserving local work and the original PR branch. |
…88790) Allow guests to prepare older PRs from newer published project history while preserving the original PR branch and protecting local work. Fixes openclaw#188751.
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]>
Fixes #188751.
What Problem This Solves
An eligible guest can be refused when preparing an older PR from a clean project checkout that contains newer published commits. The workspace is reported as dirty or unpublished because its HEAD is not an ancestor of the PR's recorded base or head, even though the project branch already contains it.
User Impact
Guests can prepare these PRs while keeping protection for actual dirty, staged, untracked, or unpublished work. This also covers a PR targeting a release branch while the project starts from newer published main, and a fork project's own published source branch. Preparation still installs the verified PR head and preserves the sandbox's original branch and HEAD.
Why This Change Was Made
The preparation caller already verifies the original project repository. It now passes that repository and the recorded source branch to the existing integration owner. When the original PR ancestry checks do not establish publication, the owner verifies that the clean workspace HEAD belongs to that authenticated project branch.
The project source is checked independently of the PR destination. This reuses the existing Git transport and ancestry checks without scanning other refs or treating a remotely uploaded commit object as a published branch. The canonical preparation documentation now explains this distinction.
Evidence
The original production code failed both same-repository and fork cases when the fixture placed the clean workspace five published commits beyond the PR's recorded base. The updated registered-action preparation suite passes all 22 cases, including differing destinations, fork-origin history, and a clean unpublished-commit refusal. Together with unchanged passing refresh and adoption coverage, 50 related cases apply to this change.
Changed-file format/lint and the native selected production and test type checks passed remotely. The preparation file took 100.06 seconds including worker preparation; its real Git and workspace-projection path is needed to exercise the ancestry and saved-work boundary. The 84 added test/fixture lines correct the earlier misleading graph and cover the distinct preservation and source-selection cases.
Independent review is clean for this head. A real guest in a required sandbox reproduced the refusal on the baseline, then prepared the same original PR successfully on this exact head. Authenticated GitHub readback confirmed its branch, head, title, body and comments were unchanged. Both an untracked-file control and a separate clean-unpublished-commit control were refused, preserving their HEADs, trees and file bytes without installing a PR binding. The exact-head full runtime build passed.
All selected hosted CI families passed except the test-line budget ratchet and its aggregate gates. The exact CI baseline,
2c157ed06dff5032da1093cbb6745efeff2b6f33, independently fails the native checker with 6,313,613 test lines against a 6,312,587 ceiling: 1,026 inherited lines. This PR adds 84 lines and an equal grant, reproducing the hosted totals of 6,313,697 / 6,312,671 without increasing that debt. The failed job remains recorded; main now contains the budget correction in #188780. The native checker passed on the prospective result with targetadb58af237c2079d8eae388b22b9ce439d19e081: 6,315,751 lines against a 6,347,719 ceiling. The original failure remains historical evidence; this receiving check does not relabel CI as green.The focused tests use synthetic external GitHub/container I/O. The live proof used actual authenticated GitHub and the required guest sandbox. A later receiving-target check also reproduced the four published-source failures on the unfixed target and passed all 22 cases with this patch.
Visual evidence
Guest submits the preparation request and receives the settled successful result
p1-after.mp4
Visual verification
61fc0253d2071d17cd591ee75236cbf8eb04850aBaseline interaction recording.