Repository navigation
fix(test): preserve Vitest cache generations - #138248
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. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Cache generation now sits with the cache owner, and invalidation clears both disk state and retained path metadata. The lifecycle boundary looks consistent.
ee0dadd to
251e8d1
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 3:38 PM ET / 19:38 UTC. ClawSweeper reviewWhat this changesThe branch updates OpenClaw’s patched Vitest runtime and regression tests so filesystem transform caches use the current lockfile generation during startup and cache clearing. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open for normal maintainer review. The branch contains a focused cache-lifecycle repair with regression coverage, and its member author plus Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test runner uses a pinned, locally patched Vitest dependency. Vitest turns test configuration and source files into cached transforms that reporters, projects, and test workers consume. flowchart LR
A[Test configuration] --> B[Vitest startup]
B --> C[Filesystem transform cache]
C --> D[Reporters and test projects]
D --> E[Test results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +219, Other +174. Total +393 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the single cache-owner generation model and land only after the exact-head CI run validates the patched Vitest package and its cache-generation scenarios. Do we have a high-confidence way to reproduce the issue? Source-reproducible: the added fixtures exercise lock transitions, early configuration imports, separate project cache roots, and an idle clear. This read-only checkout has no installed Vitest dependency, so the scenarios could not be executed here. Is this the best way to solve the issue? Yes: carrying the lock generation in the cache owner and excluding pre-initialization imports from persistent-cache lookup is the narrowest coherent repair; the tests cover the distinct lifecycle boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against da906236e643. 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
|
|
Merged via squash.
|
Vitest could preload a custom reporter before validating its persistent transform cache, then delete the directory backing a memoized cache path when the installed lock changed. The initialization failure was reproduced through the normal test runner. Public API probes also exposed stale transforms after an awaited idle cache clear, across separate project cache roots, and after clearing, repopulating, then restarting with a changed lock.
Keep cache readiness and generation in the cache owner: prepare the workspace lock hash before reporter imports, include that generation in cache keys, and retire cached path metadata through the existing invalidation flow on clear. Early configuration-hook imports use ordinary uncached transforms until initialization completes; same-generation reporters and tests retain warm reuse. Existing worker shutdown behavior and the Vitest version are preserved.
Regression coverage uses the public Vitest APIs and existing fixture/process limits. Original-engine runs reproduced the hook/idle-clear failures; two later generation regressions failed on the first repair and pass on the final repair. The signed integration head
251e8d12passes all 18 cache/reporter/compiler cases, all 14 Gateway session-tool cases, and the normal 28-command changed gate, including 94 generated npm-lock validations. Independent Codex review completed two passes without findings. An earlier review identified the two generation gaps; both were reproduced and fixed before the clean reviews.The earlier hosted run 33875933007 failed on the old head. The integration includes main's Android test observation fix and Gateway fixture updates; the historical Gateway timeout phase remains unproven. That failed result stays recorded, and hosted CI must validate this updated head. Source qualification against captured main
0062f2b1confirms the three-file patch composes; local execution is attributed to251e8d12and its tested dependency graph.Scope: OpenClaw production code +0/-0; patched Vitest implementation +37/-25 (net +12) for cache lifecycle ownership; tests +258/-39 (net +219); lockfile +8/-8 for the unchanged-version Vitest patch identity.