Repository navigation
fix: refresh prepared PRs from the live target branch - #190576
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 changesPrepared PRs refresh from the live target branch and retain the correct review comparison when GitHub PR metadata lags. Example: The target advances from fe892761 to 0b8d8025 while PR details retain the older SHA.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a source-confirmed target-selection bug still present on main; no actionable introduced defects remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway preparation owner verifies the conversation and PR, selects a target commit, and delegates file integration and review-base preparation to the existing workspace owners. flowchart TD
A[Conversation GitHub action] --> B[PR preparation owner]
B --> C[Requester and PR verification]
C --> D[Guarded live branch reader]
D --> E[Workspace integration owner]
E --> F[Saved files and review comparison]
Technical reviewBest possible solution: Land the focused live-ref selection fix through the existing preparation and integration owners. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the stale-SHA path, and the linked report and inspected baseline screenshots demonstrate its observable result; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete repair: select the live commit in the preparation owner, preserve pending integration, and reuse the existing guarded transport and review-base machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d2a218c9b69a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +23, Tests +50, Docs +2, Other +2. Total +77 across 5 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 November 1, 2026, 2:21 PM ET / 19:21 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: prepared PRs refresh the live target branch while preserving their review comparison through conflict resolution and repeated preparation. |
Refresh prepared PR workspaces from the current target branch and preserve their review comparison when GitHub PR metadata lags. Keep pending conflict resolution on its accepted base while retaining the original PR identity and saved guest work. Fixes openclaw#190561.
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]>
Closes #190561.
What Problem This Solves
A conversation continuing an existing PR can report that its base is current even after the target branch advances. GitHub PR details may retain an older base SHA while the branch-ref endpoint already names the new tip. Using that PR-detail SHA leaves newer target files out of the workspace. After integrating a newer base, repeated preparation must also avoid resetting the review comparison to that older metadata.
User Impact
A fresh
refresh_baseintegrates the current tip of the verified target repository and branch for both imported PRs and PRs originally published by the conversation. Repeatingprepare_prafterward preserves the correct review comparison, so integrated upstream files do not appear as PR changes merely because GitHub's PR details lag.The accepted PR head and identity remain intact for subsequent publication. A pending conflict continues against its accepted commit; a later fresh refresh picks up further target changes. There are no configuration, schema, dependency, or permission changes.
Why This Change Was Made
The preparation owner already verifies the PR destination and distinguishes new selection from pending integration. It now uses the existing guarded branch-ref reader for a fresh refresh, and when preparation sees disagreement between the accepted base and the metadata for the same destination. Reading the live ref distinguishes stale metadata from a target that actually moved, without adding a cache or another integration mechanism.
The registered-action regression keeps PR metadata unchanged while the same Git branch advances, then repeats preparation and checks the saved comparison and cached diff. The existing conflict/publication scenario advances the target during a pending conflict and verifies that resolution finishes the earlier target before a fresh refresh imports the new tip. An existing preparation fixture now creates the actual branch it retargets to. The 50-line test-budget allocation covers those missing conditions and that required fixture adaptation.
Evidence
On unchanged main, both PR-origin variants returned
currentwith the old commit instead of the independently advanced branch commit. A follow-on regression also reproduced the stale review comparison after repeated preparation. The corrected candidate passes all 85 cases across the five related action, preparation, source-adoption, and integration files.Changed-file formatting/lint and affected production/test type checks passed; unaffected type-graph results were retained under unchanged consumer contracts. The five test files passed with one worker in 228.05 seconds (230.72 seconds including the native shard wrapper). They use real Git, request authority, and workspace state with external GitHub fixtures; helper-only tests would miss the selection and recovery boundaries. Hosted CI timing for this revision remains pending.
The live baseline reproduced the stale result through actual guest conversations for both PR origins, with independent GitHub PR-detail and branch-ref reads. On the corrected build, both conversations selected the live target, retained the accepted base while it advanced during conflict resolution, then picked up the newer tip on a fresh refresh. Both published directly to their original PRs without intervening preparation; original head history, saved files, authors and public metadata were preserved.
All selected CI jobs and both source reviews are green for the current head. After publication refreshed GitHub’s metadata, a further real target-branch advance restored the stale-metadata condition. Both guest conversations refreshed that target and repeated preparation while preserving the correct review base, files, indexes, heads and bindings. Returning guests remained denied merge after admin inspection; authorized admins then merged the original fixture PRs, with independently verified file trees matching their final published heads.
The matched captures and recording below show the initial fresh-base transition; separate native receipts establish the later resolution, publication, repeated-preparation and permission checks. This is isolated Guest Lab proof, not a production deployment or full release claim.
Visual evidence
Guest refresh selects the live base and returns actual conflicts
external-after-native.mp4
Visual verification
a3a00c492bb36c4790169facd3c6549c8cd06815