Repository navigation
fix(pr): prevent parallel main refreshes from colliding - #134014
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 11:27 AM ET / 15:27 UTC. ClawSweeper reviewWhat this changesThe branch prevents shared Git-ref collisions during PR refreshes, scopes CI checkout authentication and historical test setup, and defers Anthropic provider auth and catalog imports until their hooks run. Merge readinessKeep open. This maintainer-authored, maintainer-labeled PR retains a concrete repair for concurrent PR-worktree refreshes, and the prior provider-documentation finding is resolved. No introduced blocking defect was found, but exact-head CI is still incomplete and the new checkout credential boundary needs its normal final validation. Priority: P2 Review scores
Verification
How this fits togetherPR tooling creates isolated worktrees and snapshots main before review and merge operations. CI then prepares shallow checkouts, tests, and provider registration paths from those snapshots. flowchart LR
A[PR operation] --> B[Per-PR worktree]
B --> C[Private main snapshot]
C --> D[Review and merge gates]
E[CI checkout] --> F[Scoped Git authentication]
F --> G[Historical test setup]
H[Anthropic registration] --> I[Deferred auth and catalog hooks]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +813, Docs 0, Config +153, Other +7. Total +1004 across 31 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the per-worktree fetch and deferred-runtime design only after exact-head CI confirms the scoped checkout path; keep provider-auth as the documented external SDK surface and provider-entry confined to bundled implementation. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the previous cold refresh wrote shared origin/main, while the introduced containment fixture holds that ref transaction and exercises concurrent warm and cold refreshes. This read-only review did not execute the fixture. Is this the best way to solve the issue? Yes. Redirecting the cold fetch to the existing per-PR branch removes the shared-state collision at its producer without adding a repository-wide mutex or retry path; the provider deferral preserves the established async hook contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c884d51b870b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
d5d87b3 to
2c5ada1
Compare
7731398 to
dd8815b
Compare
|
@clawsweeper re-review The current head is Local verification includes 367 routing cases, six real-browser focus cases, the required changed checks, and a fresh combined scoped review. The Anthropic source hashes match its 170-test, full-build, source/compiled-hook and profiler receipt. Exact-head CI remains required: https://github.com/openclaw/openclaw/actions/runs/33399315161 |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The public provider tutorial now uses Current head: The repository-scoped, process-only checkout credential design remains within the maintainer-authorized release repair. The PR body records its isolation and cleanup proof. Exact-head CI is still required before landing: https://github.com/openclaw/openclaw/actions/runs/33404287226 |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Preserve the recovery coverage added in #134165 while using the actual WebSocket dependency and authored SecretRef fixture boundary. Co-authored-by: Shakker <[email protected]>
Keep provider descriptors synchronous without importing credential stores, external auth discovery, or live catalog transport during registration. Load those implementations only when the existing asynchronous setup, doctor, usage, and catalog hooks need them. Expose the existing lightweight API-key descriptor factory through provider-entry while preserving the shipped auth SDK helpers and their synchronous contracts. The unchanged fresh-process registry proof retains its original timeout and verifies scoped failover without global activation.
Wait for opening focus initialization and visible popup retirement before exercising selection and typing ownership. Preserve the existing focus, selected-agent, and composer assertions without changing product behavior or timeouts.
ccf83fc to
4f3e8ba
Compare
|
Canonical preparation completed for Exact-head CI33407712263 completed successfully, including both Windows lanes, macOS, all selected runtime/UI/Git tests, typecheck, lint, dependencies, builds and i18n. The native preparation verified the same local and remote head and skipped an unnecessary push. The three Testbox workflows also passed on the preceding patch-identical revision, and their local shallow-Git proof covers both successful base pinning without network fetches and fail-closed missing history. The shared main fixture correction #134207 is now merged as ace8a13f19cc. This branch was refreshed once onto its complete reviewed ancestry; all ten release-repair commits remained patch-identical. No later advisory rebase, credential widening, timeout increase or assertion waiver was used. Local verification retained the real Git concurrency and smart-HTTP isolation proofs, immutable-reader compatibility proof, full Knip checks, provider cold-import build/profile proof and six browser focus cases. After the final rebase, The latest ClawSweeper review covers this exact head and has no actionable findings. Its remaining request was green exact-head CI with authentication isolation assertions retained; both are satisfied. The public provider-auth documentation correction is preserved, and no persistent-store behavior changed. Live main rules require the normal CI gate and do not require a separate review approval; no bypass route is being used. Earlier CI failures and cancellations remain recorded in the PR body. A local pre-prepare Git HTTPS fetch also stalled; only that owned fetch was stopped, its children were verified gone, and the native wrapper's exact operation-lock recovery was used before the single checkpoint retry. No merge request had been sent during that recovery. |
|
Merged via squash.
|
Keep the independently landed main fixture from #134014 byte-identical while preserving the separately verified theme-transition regression.
) * fix: restore gateway recovery fixture lint and types Preserve the recovery coverage added in openclaw#134165 while using the actual WebSocket dependency and authored SecretRef fixture boundary. Co-authored-by: Shakker <[email protected]> * fix(pr): prevent parallel main refreshes from colliding * test(pr): observe private main refresh checkpoints * fix: authenticate CI checkout and lazy blob fetches * fix: prepare immutable reader history during CI checkout * fix(ci): declare historical reader selector entry point * test: include historical prerequisite in routing expectations * perf(anthropic): defer auth and catalog runtime imports Keep provider descriptors synchronous without importing credential stores, external auth discovery, or live catalog transport during registration. Load those implementations only when the existing asynchronous setup, doctor, usage, and catalog hooks need them. Expose the existing lightweight API-key descriptor factory through provider-entry while preserving the shipped auth SDK helpers and their synchronous contracts. The unchanged fresh-process registry proof retains its original timeout and verifies scoped failover without global activation. * test(ui): await agent menu lifecycle before keyboard navigation Wait for opening focus initialization and visible popup retirement before exercising selection and typing ownership. Preserve the existing focus, selected-agent, and composer assertions without changing product behavior or timeouts. * fix(ci): prepare Testbox against the checked-out merge base * docs(plugins): use public provider auth import in tutorial --------- Co-authored-by: Shakker <[email protected]>
Related: #133896 (native release preparation contention), #134049 (superseded OpenGrep repair, now covered by #134054 on main), #134136 (Testbox preparation after a successful build).
What Problem This Solves
Maintainers refreshing different PR worktrees could fail with Git ref-lock or compare-and-swap errors because each refresh mutated shared
origin/main. The release verification also exposed checkout authentication ending before implicit blob hydration and a historical-reader test trying to fetch its immutable prerequisite after checkout credentials were removed.Why This Change Was Made
Native main refreshes now write only the current PR worktree's private
FETCH_HEAD. Cold provisioning seeds the existing per-PR temporary branch without changing canonicalFETCH_HEAD, initializes the worktree, and takes the normal private checkpoint. Canonical origin, wrapper trust, per-PR locks, interrupted-checkout recovery, exact-head guards and merge authority remain intact. There is no repository-wide mutex or additional retry loop.The existing CI checkout owner supplies repository-scoped authentication through process-only Git configuration for explicit fetches and implicit promisor-blob hydration, then clears it. The test planner selects immutable historical-reader commits only for the owning Node shard; checkout fetches those objects before credentials leave scope. Workers receive no credentials, and compatibility assertions and deadlines are unchanged.
All three Testbox workflows now resolve the actual merge first parent with the existing resolver before ensuring history, and pass that same result to Testbox’s base pin. Linear and manual-dispatch bases remain unchanged. This removes the stale event-base fetch exposed after the successful artifact build in #134136; the generic exact-SHA history policy is unchanged.
User Impact
Maintainers can refresh independent PR worktrees while another Git operation owns the shared remote-tracking ref. CI can prepare shallow checkouts and historical-reader prerequisites without persistent credentials. Anthropic provider registration also defers credential-store, external-auth, and live-catalog imports until their existing asynchronous hooks run, reducing cold registration cost while preserving authentication and SDK contracts.
Evidence
origin/mainref while warm and cold review checkouts run concurrently. Before the fix, both fail and the cold path changes canonicalFETCH_HEAD; afterward, both reach canonical main while shared state remains unchanged. The original containment suite passed all 39 cases.5dc4cf602bc5e263e83cd16a12bb1e100544f4c3and candidate reopen proof passed in 24 seconds. No test timeout or compatibility assertion was relaxed.dd8815bce8c861e67a1d72194e3e0d56ce7a1f5e: 36 selected prerequisite, native concurrency, manifest and OpenGrep cases passed; actionlint, Zizmor, generated-owner validation, composite interpolation and diff checks passed. Fresh combined-diff P0 Autoreview is clean. The full local changed gate passed before the mechanical rebase; range-diff proves all four remaining commits are patch-identical.f245bd7957caaacbb80018a6da6e47c45966637dalso declares the trusted selector in Knip’s canonical executable entry list, since inline workflow imports are not statically discoverable. Fullpnpm deadcode:fullpassed both stages (51.6s and 52.4s); formatting, diff checks and fresh combined-diff P0 Autoreview passed. No unused-code exclusion was added.b07535b582ebed082029a6bc12a87f51cbb830eepassed both Windows lanes, all selected Linux/compact/UI, lint, dependency and SQLite lifecycle jobs. Its native-i18n job exhausted its 10-minute cap during dependency setup after checkout consumed 9m28s; no i18n assertion ran. Prior run33393515458 preserved an audit lease timeout, UI focus precondition failure, stale routing expectation and explicit lint runner shutdown; none is described as passed or waived.ccf83fcd3336fc11bb803a7dea3d68c01605b89ealso corrects the provider tutorial to use the existing publicprovider-authexport, which ships declarations. The bundled-only lightweight entry remains unchanged. Fresh combined P0 Autoreview is clean; required changed-file and workflow checks passed. Exact-head hosted CI remains required before landing.The rebase resolved an actual conflict after #134054 landed the equivalent OpenGrep repair. Both OpenGrep files now match main exactly; this PR no longer duplicates that change. Main's stronger shallow-merge, linear and missing-history regression cases passed in the final focused run. #134049 is closed with canonical main and exact CI/SARIF proof.
Production/tooling growth: 100 executable lines, 10 metadata lines, 51 generated workflow lines and 30 Testbox workflow wiring lines. Test/support growth: 798 lines; maintainer guidance and documentation: net zero. The executable growth establishes scoped authentication and immutable-history preparation in the existing checkout owner and deferred provider imports. Testbox adds only step/output wiring to the existing merge-base resolver. There are no persistent credentials, broader retries, new configuration, dependency overrides, timeout increases, storage changes or alternate landing routes.
The two remaining failures in run33404287226 were new-main gateway fixture lint/type errors, covered by the independently reviewed correction #134207. Head
4f3e8ba6514610d8de0fa652c61834da22486830is rebased once onto that complete reviewed correction ancestry. All ten retained commits are patch-identical in range-diff; no conflicts, dropped fixes or dependency-pin changes occurred. The 11 focused Testbox/workflow/routing cases passed again, and fresh full-native-delta P0 review is scoped clean. #134207 must land before this PR.