Repository navigation
test: guard multi-project Vitest cache ownership - #133554
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:26 PM ET / 21:26 UTC. ClawSweeper reviewWhat this changesThis PR adds a real child-Vitest regression that verifies shared cache reuse, lock-transition invalidation, and freshness of a later-selected project. Merge readinessKeep open. The PR adds a distinct regression guard for the existing cache policy and introduces no actionable correctness or security defect; its exact-head CI is still running. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s Vitest configuration assigns filesystem-cache locations for developer test runs. This test launches real Vitest children with the project and scoped configuration builders, then observes transform reuse and invalidation through fixture output. flowchart LR
A[Developer test command] --> B[Vitest configuration builders]
B --> C[Filesystem cache location]
C --> D[Project A and Project B]
D --> E[Vitest transform cache]
E --> F[Transform and freshness assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +132. Total +132 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the real-child-process regression as the cache-policy guard, with the shared configuration builders remaining the single source of cache settings. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a guard for an existing test-tooling invariant rather than reporting a current product defect. Is this the best way to solve the issue? Yes. It exercises the existing aggregate and scoped configuration builders through real child Vitest processes, rather than duplicating cache-key logic in a unit-only fixture. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 08d09c4d9704. 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
|
|
Land-ready evidence for Native main-baseline/PR-head review is complete; OPENCLAW_VITEST_FS_MODULE_CACHE_PATH="$PWD/.artifacts/vitest-cache-regression-pr/outer-cache-parent" node scripts/run-vitest.mjs test/vitest-performance-config.test.ts test/vitest-projects-config.test.ts test/vitest-scoped-config.test.ts --reporter=verbose
node_modules/.bin/oxfmt --check test/vitest-performance-config.test.ts
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts
git diff --check 50b675ffe1768daec52fbcc5fb01042310c81667...HEAD
node scripts/watch-pr-ci.mjs 133554 3266d12e41e616dab4d6e41406423f232ea3289e
scripts/pr review-validate-artifacts 133554Focused proof: 131 passed independently on Node 26 and Node 24; final owner rerun 10/10. Omitting only fixture root cache settings fails repeated A at The local typecheck remains failed because installed grammy 1.45.1 differs from the 1.46.0 pin. Successful hosted test types, production types, core type stripes, and lint, using the normal frozen-lockfile setup, resolve that evidence gap without local dependency changes. Production +0/-0; tests +151/-19. No source/dependency changes during readiness. Stopped before |
|
Merged via squash.
|
* origin/main: (55 commits) test: include v2026.8.1 release navigation (#133581) fix: stop cloud work before unrelated provider inspection finishes (#133476) fix(e2e): keep delete fixture target-compatible (#133526) fix(release): detect optional target E2E capability (#133525) fix(package): publish readable dist inventory (#133549) docs: add complete v2026.8.1 maintainer change index (#133585) fix(browser): preserve contextless worker and iframe sessions (#133571) fix(voice): discover configured provider candidates (#133507) refactor(ui): simplify chat rendering and lifecycle state (#133567) test: reduce maturity fixture cleanup time (#133566) improve: speed up legacy imports and transcript replacement (#133546) docs: add draft v2026.8.1 release notes (#133557) test: guard multi-project Vitest cache ownership (#133554) fix(memory): clarify default agent scope in command help (#133560) fix(clawdock): keep credentials out of diagnostic output (#133547) refactor(ui): avoid redundant presence work in avatar lists (#133548) fix(agents): recognize internal requester completion replies (#133543) fix: prevent duplicate queued user messages in chat clients (#133542) chore(ui): refresh control ui locales (#133544) fix(beam): restart delivery when the receiver changes (#133533) ...
…cked-delivery * origin/main: test: include v2026.8.1 release navigation (openclaw#133581) fix: stop cloud work before unrelated provider inspection finishes (openclaw#133476) fix(e2e): keep delete fixture target-compatible (openclaw#133526) fix(release): detect optional target E2E capability (openclaw#133525) fix(package): publish readable dist inventory (openclaw#133549) docs: add complete v2026.8.1 maintainer change index (openclaw#133585) fix(browser): preserve contextless worker and iframe sessions (openclaw#133571) fix(voice): discover configured provider candidates (openclaw#133507) refactor(ui): simplify chat rendering and lifecycle state (openclaw#133567) test: reduce maturity fixture cleanup time (openclaw#133566) improve: speed up legacy imports and transcript replacement (openclaw#133546) docs: add draft v2026.8.1 release notes (openclaw#133557) test: guard multi-project Vitest cache ownership (openclaw#133554) fix(memory): clarify default agent scope in command help (openclaw#133560)
Related: checkout-owned Vitest cache isolation (#132867).
Additional instructions
This is a same-repository, maintainer-editable branch.
What Problem This Solves
Adds maintainer-requested behavioral regression coverage for the existing shared-leaf Vitest cache workaround. Vitest 4.1.11 can repeatedly discard project transforms when invocation metadata lives elsewhere; merely making a global marker current can instead leave an unselected project's transforms stale.
Current OpenClaw configuration already co-locates root metadata and project transforms. The existing tests protect checkout isolation and configuration shape, but do not prove reuse and later-project freshness across a lockfile transition.
Why This Change Was Made
Exercise the actual
createProjectShardVitestConfigandcreateScopedVitestConfigcache settings through real Vitest CLI children in one temporary namespace. Warm two projects, change a fixture-owned lockfile and synthetic external-plugin generation, run A twice, then B twice. Assert actual transform counts and independently check the executed dependency-generation export. Continue with a source edit and a project-alias change to ensure ordinary invalidation still works.The existing child launcher is shared by both ownership tests. Its 15-second child deadline is unchanged. No dependency, production cache policy, heap, retry, pool, isolation, or worker-budget change; no metadata rewrite or custom cache-key override. This does not implement the separate compiled-worker campaign or repair Vitest's generic separated-root contract.
User Impact
No operator/runtime behavior changes. Developers gain a guard against accidentally separating cache validity from transforms or allowing stale transforms in a later-selected project.
Production LOC: +0/-0. Test LOC: +151/-19 (net +132), one test file.
Evidence
[3, 1]versus expected[2, 1]. The mutation was removed. This is an intentional negative control, not a claim that current main is broken.[1,1]; lock transition/A repeat[2,1]; later B/B repeat[2,2]; A source edit[3,2]; alias edit/repeat[4,3].git diff --checkpassed. Source-only scripts lint exited 0. Fresh Codex autoreview returned scoped-clean at its default P0 threshold; parent manual review also completed.Focused command (the outer cache is proof-owned; the inner test has its own independent temporary cache):
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH="$PWD/.artifacts/vitest-cache-regression-pr/outer-cache-parent" node scripts/run-vitest.mjs test/vitest-performance-config.test.ts test/vitest-projects-config.test.ts test/vitest-scoped-config.test.ts --reporter=verboseLocal validation gap: after fast-forwarding this checkout, installed grammy remains 1.45.1 while main pins 1.46.0. Root-test typechecking reports eight existing Telegram type errors (
RichMessageButtonand newer update/message variants), none in the changed file. Dependencies were deliberately left untouched. Exact-head CI with the pinned install must pass typechecking and all required gates before merge. An initial lint invocation using the root tsconfig hit the same declaration-preparation failure; the correct source-only scripts lane subsequently exited 0.