Skip to content

fix(ci): restore Vitest cache reuse - #154121

Merged
steipete merged 3 commits into
mainfrom
codex/vitest-ci-cache-reuse
Sep 21, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/vitest-ci-cache-reuse

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes repeated cold Vitest work when CI cannot restore the protected warmer's transform cache and the test wrappers disable Node bytecode caching for ordinary runs.

User Impact

No product behavior changes. Developer and CI tests can reuse their intended caches; V8/custom coverage workers retain Vitest 5's native safeguard. This is maintainer-requested test and CI maintenance.

Why This Change Was Made

Exclude the generated .ci-harness checkout from transform fingerprints so its copied action manifests cannot separate consumers from the warmer. Remove both obsolete wrapper-level bytecode guards and use Vitest 5's client optimizer setting.

Optimize Lit's exported entry points together to keep browser/development internals consistent. Keep CodeMirror and Lezer within Vite's module graph: versioned direct imports and query-free native transitive imports otherwise create duplicate class and parser-property identities. The root and package UI entry points share this dependency policy.

Protected cache publication, runner allocation, isolation, and coverage settings retain their existing owners. Hosted transform warming remains a separate follow-up.

Evidence

  • Three regression cases fail against the original cache owners, then pass with the repair; real dependency/config/schema inputs still invalidate the transform fingerprint.
  • Linux Testbox: 637 workflow guards, 199 runner tests, and 60 Lit view tests passed; workflow validation and changed-file checks passed. Updated configuration also passed root test types and targeted lint/format checks.
  • The first CI run exposed a stale optimizer.web assertion plus split Lit/CodeMirror/Lezer identities. The original 415-file two-worker UI shard reproduced its eight highlighting failures. After the complete dependency cutover it passes 6,547 tests with three intentional skips; all 44 affected highlighting/editor tests pass through both root and package UI entry points. The 332 config-contract tests pass.
  • Measured single-worker file cost: workflow guards 126.73s; runner tests 2.24s; config contracts 57.89s wrapper wall (56.95s Vitest). These existing suites cover broad executable workflow/inventory contracts. The added fingerprint case uses in-memory data and adds no subprocesses or timers.
  • Eight real-wrapper coverage runs verified threads/forks and spawned children with identical TypeScript/native-CJS coverage JSON. Prior controlled cache experiments improved selected warm medians; no whole-CI speedup or Lit speedup is claimed.
  • Fresh independent review found no actionable issues. Required CI passed on the updated head: https://github.com/openclaw/openclaw/actions/runs/35544880211.

CI reported case-time sums were 127.608s for workflow guards, 1.049s for runner tests, and 42.661s for config contracts (excluding imports/setup, not file wall time). The changed cases cost 29ms for fingerprint parity, 0ms each for bytecode forwarding at reporter resolution, and 5ms for the UI owner assertion.

@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 22:22
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 8:05 PM ET / September 21, 2026, 00:05 UTC (Revision 4).

ClawSweeper review

What this changes

Restores test cache reuse by excluding generated CI harness files from cache fingerprints, preserving Node cache settings, and aligning UI test dependency loading with Vitest 5.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main retains the cache blockers, and related cache work does not supersede it. No actionable correctness or security defects were found.

Priority: P2
Reviewed head: 4b9f03d105f76181171c62bbfe0be56d064c71ef

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant regression coverage, verified successful CI, and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this maintainer-authored infrastructure PR. The body reports wrapper coverage parity and repaired UI shard execution, and the linked CI run was verified against the pinned head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-authored infrastructure PR. The body reports wrapper coverage parity and repaired UI shard execution, and the linked CI run was verified against the pinned head.
Evidence reviewed 8 items Pinned introduced changes: Reviewed the merge-base-to-head patch. Changes concern CI fingerprinting, test launch environments, UI test configuration, regression coverage, and documentation; the transcript-storage changes in endpoint drift are not introduced by this PR.
Repair still needed on main: Fetched main still strips inherited Node compile-cache settings, includes generated harness manifests in transform fingerprints, and uses optimizer.web. No implemented-on-main conclusion is supported. Inspection of the latest release blob was unavailable, so no release inclusion is claimed.
Cache ownership remains intact: CI materializes copied action files under .ci-harness, while the warmer uses the source checkout. Excluding those copies aligns fingerprints without changing protected publication, restore-only consumers, cache paths, or writer controls.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test launchers and CI setup prepare dependencies and caches before Vitest runs. These changes affect repeated test startup work and UI test module identity, without changing the shipped application.

flowchart LR
  A[Source and dependency inputs] --> B[Cache fingerprint]
  C[Generated CI harness] --> D[Exclude generated copies]
  D --> B
  B --> E[Restore protected caches]
  E --> F[Vitest test launchers]
  F --> G[Coverage safeguards and shared dependencies]
  G --> H[Test results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +57, Docs +2, Config +1, Other -17. Total +44 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 5 100 43 +57
Docs 1 2 0 +2
Config 1 2 1 +1
Generated 0 0 0 0
Other 2 8 25 -17
Total 10 113 69 +44

Review metrics

None.

Technical review

Best possible solution:

Keep cache policy with the existing CI owner and coverage safeguards with Vitest, using one shared UI dependency policy.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main includes copied harness manifests in its fingerprint and unconditionally disables inherited bytecode caches in test launchers. No local runtime reproduction was executed.

Is this the best way to solve the issue?

Yes. The patch repairs the existing owners, removes redundant wrapper policy, and applies the supported Vitest optimizer configuration consistently.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7974d9cf48d7.

Labels

Label justifications:

  • P2: Repairs repeated cold test work with a bounded CI and developer-tooling scope.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored infrastructure PR. The body reports wrapper coverage parity and repaired UI shard execution, and the linked CI run was verified against the pinned head.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head patch. Changes concern CI fingerprinting, test launch environments, UI test configuration, regression coverage, and documentation; the transcript-storage changes in endpoint drift are not introduced by this PR. (4b9f03d105f7)
  • Repair still needed on main: Fetched main still strips inherited Node compile-cache settings, includes generated harness manifests in transform fingerprints, and uses optimizer.web. No implemented-on-main conclusion is supported. Inspection of the latest release blob was unavailable, so no release inclusion is claimed. (scripts/lib/vitest-process-env.mts:196, 7974d9cf48d7)
  • Cache ownership remains intact: CI materializes copied action files under .ci-harness, while the warmer uses the source checkout. Excluding those copies aligns fingerprints without changing protected publication, restore-only consumers, cache paths, or writer controls. (.github/actions/setup-node-env/action.yml:218, 4b9f03d105f7)
  • Dependency safeguard verified: The PR explicitly relies on Vitest 5 owning coverage safety. Its tagged source disables NODE_COMPILE_CACHE and sets NODE_DISABLE_COMPILE_CACHE before creating workers for enabled V8/custom coverage; inspected thread and fork implementations pass that environment into their workers. Vitest’s configuration types also identify client as the optimizer environment. (packages/vitest/src/node/pool.ts:128, f441c6fab25e)
  • UI dependency cutover: Root jsdom projects consume the shared Lit optimizer policy, and package UI projects now consume the same server dependency policy. CodeMirror and Lezer remain within the Vite module graph rather than acquiring separate native dependency identities. (ui/vitest.config.ts:126, 4b9f03d105f7)
  • Validation and review continuity: GitHub confirms the linked CI run completed successfully for the pinned head. The captured PR body reports original-failure regressions, eight real-wrapper coverage comparisons, and the repaired original UI shard passing 6,547 tests. These reported experiments were not rerun during this read-only review. The previous completed review covered the same head and retained no findings or published rank-up moves. (4b9f03d105f7)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-20T22:29:31.045Z sha ec748d3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T23:26:12.755Z sha 1dabe2b6c1b55fc8dacdc0fa47f3faf667895999 :: needs changes before merge. :: none
  • reviewed 2026-09-20T23:37:32.875Z sha 4b9f03d :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@steipete
steipete force-pushed the codex/vitest-ci-cache-reuse branch from 1dabe2b to 4b9f03d Compare September 20, 2026 23:31
@steipete
steipete merged commit a4e3a5d into main Sep 21, 2026
172 checks passed
@steipete
steipete deleted the codex/vitest-ci-cache-reuse branch September 21, 2026 01:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
* fix(ci): restore Vitest cache reuse

* test(ci): keep cache fingerprint fixtures strictly typed

* fix(test): preserve UI dependency identities with optimization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant