Repository navigation
fix(update): avoid repeated private candidate scans - #169075
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: blocked before merge. What this changesThis PR replaces repeated fresh-candidate content scans with directory, version, and launcher checks during uninterrupted npm package publication. Example: A POSIX npm update publishes version 2.0.0 with one launcher.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR provides a useful update optimization absent from current main, with no identified introduced code defect; the earlier conflict is resolved. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe installed updater gives prepared fingerprints and executor authority to the publication owner, which replaces package directories and launchers and records recoverable progress in the activation journal. flowchart TD
A[Installed update CLI] --> B[Candidate preparation]
B --> C[Publication owner]
C --> D[Package and launcher filesystem]
C --> E[Activation journal]
E --> F[Recovery executor]
F --> C
Technical reviewBest possible solution: Keep the optimization in the existing publication owner while preserving full verification for resumed recovery and rollback. Do we have a high-confidence way to reproduce the issue? Current-main source shows repeated candidate walks, and the changed filesystem fixture measures their reduction; this review executed no target code. Is this the best way to solve the issue? The existing publication owner is the appropriate boundary, and the owner explicitly accepts the reduced same-window verification while retaining strict recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3e65a92f225f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests +44, Docs +7. Total +50 across 7 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 11, 2026, 7:54 AM ET / 11:54 UTC (Revision 2). |
Use directory identity, package version, and launcher checks for a freshly prepared private candidate during uninterrupted publication. Preserve its full fingerprint and disable the fast path after failure or when recovery resumes. Same-window content drift is an accepted tradeoff. Keep legacy recovery behavior and consolidate recovery artifact names and identities into one inventory. Release note: package updates avoid repeated candidate tree scans without changing backup or rollback ownership.
2a1cca5 to
880f812
Compare
…idate (openclaw#169075) Package publication no longer rescans the whole tree of the candidate it just installed into a private directory; it checks identity, version and launcher on the uninterrupted path. Recovery and legacy records keep full verification. Accepted tradeoff (named in code): same-window content drift of our own private candidate is not detected. Measured: publication 121 s -> 75 s, total update 451 s -> 360 s. Production -1 LOC.
First-parent upstream 5ed6a30..cb1b6cd (21 commits, including openclaw#168999 state query reduction and worker moves, openclaw#169075, af03aa0 ACP owner settlement, openclaw#168837 plugin metadata/reload ownership, openclaw#168776, openclaw#168951, openclaw#169039 runtime-only server builds, openclaw#169092 test batch d050, openclaw#168860 memory index publication writes into workers, openclaw#168991 session read lifetimes and reconciliation scheduling, openclaw#169091 tool/replay prompt prefixes, openclaw#168762 Solid chat leaf elements, openclaw#168941). Conflicts: - test/vitest/vitest.unit-fast-paths.mjs: upstream stopped forcing the two ACP translator files into the fast lane; kept that and our reply-turn-admission module-identity entry. - worker-access inventory: regenerated (634 files, 2429 calls). openclaw-state-worker-contract.ts auto-merged: upstream's GitHub publication-source operations next to our continuation custody operations. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
POSIX npm updates repeatedly walk a candidate package that the updater just installed in private staging, adding unnecessary time to publication.
User Impact
Fresh candidate publication uses directory identity, package version, and launcher checks. Same-window content drift inside that private candidate is intentionally not detected. Current-format recovery still verifies recorded full fingerprints after interruption and on retries; existing legacy recovery behavior, backup ownership, and rollback remain intact. Older installed updaters retain their own checks.
Why This Change Was Made
Capture the candidate fingerprint once, then avoid repeated candidate tree walks during uninterrupted publication. Disable the fast path after an error and before rollback. Preserve the previous-package observation reuse from #168958 and the current legacy recovery policy. A single artifact inventory now supplies both names and current identities for retirement.
No configuration, CLI, schema, or dependency changes. Production: +152/-153 LOC, net -1; tests: +116/-72, net +44; docs: +7. Runtime retention and Doctor execution are unchanged.
Evidence
Controlled local Docker comparison: 16 CPUs, 8 GiB RAM, native
/tmpvolume, tiny isolated state, identical driver/candidate source within each cell. Before:6e06137f85ef3262f47dae63626d97f14c2f1ca1; after:2a1cca52bc7f860c31555ddf3b030419a369c523. These timing runs precede the later legacy-recovery integration; the final head is independently covered by the tests and released-driver cell below. One pair, not a statistical benchmark; phase steps can overlap.Publication was 38.1% faster; total update was 20.2% faster. Both cells passed managed restart,
/readyz, build identity, durable history preservation, and incognito cleanup. The two-minute target is not met.Final head:
880f812722e3585d5245e5cb3f00dae97d542fbf, based on3e832726ad2a19e1a19d07651e7817a6dd8aa2b9.node scripts/run-vitest.mjs src/infra/package-update-activation-bounds.test.ts src/infra/package-update-publication-boundary.test.ts src/infra/package-update-publication-durability.test.ts --maxWorkers=1). File wall times: bounds 1.134 s, boundary 14.728 s, durability 10.648 s. No CI timing claim.check:changedstops at inherited unused-export findings in unchanged agent, talk, and UI files. Its nine later checks were run separately and passed. No suppressions or baselines were changed.850592aad392dabf17a2c45889687404716fc598e909e7affefdd88ebd0b3038.