Skip to content

chore(test): pin Vitest 5 config semantics - #138208

Merged
vincentkoc merged 1 commit into
mainfrom
test/vitest5-config-parity
Sep 4, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test/vitest5-config-parity

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #137201

Follows the sequential API preparation landed in #138175.

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Vitest 5 changes two test configuration defaults: mock call history is cleared before each test, and inline projects inherit their declaring root configuration. Without explicit parity settings, OpenClaw's shared setup history can disappear and independently composed UI projects can inherit duplicate plugins, aliases, setup files, and inventory.

Why This Change Was Made

This preserves the current Vitest 4 behavior before the dependency upgrade by explicitly retaining mock history and marking complete inline UI projects as independent. A small shared helper bridges Vitest 4's narrower type definition while emitting the extends: false value required by Vitest 5.

The focused extraction derives from Peter Steinberger's migration work in #137202. Peter remains credited in the commit trailer.

User Impact

There is no product runtime change. Developers keep deterministic test selection, resource ownership, and mock-history behavior when the Vitest 5 upgrade lands.

Evidence

  • Base: 22f6c810da9a59186d7add366fe59c7f125aa8a2
  • Focused config suites: 3 files, 68 tests passed
    • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs test/vitest-projects-config.test.ts test/vitest-ui-package-config.test.ts test/vitest-ui-e2e-config.test.ts
  • Root test types passed:
    • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-root.tsbuildinfo
  • UI types passed:
    • node scripts/run-tsgo.mjs -p tsconfig.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/ui.tsbuildinfo
  • Formatting and git diff --check passed
  • Exact-diff autoreview against origin/main: scoped clean, no P0/P1 findings, confidence 0.98

Co-authored-by: Peter Steinberger <[email protected]>
@vincentkoc vincentkoc self-assigned this Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review September 4, 2026 11:00
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 8:03 AM ET / 12:03 UTC.

ClawSweeper review

What this changes

The branch explicitly keeps Vitest 4 mock-history behavior and prevents complete inline Control UI test projects from inheriting their declaring root configuration under Vitest 5.

Merge readiness

✅ Ready for maintainer review

The patch is a correct, narrowly scoped Vitest 5 compatibility preparation with no actionable defect found. It remains open for normal maintainer handling because it is maintainer-owned and labeled for maintainer review; the supplied member decision accepts landing this isolated preparation while the broader migration remains separately tracked.

Priority: P3
Reviewed head: a669b2cb2ac20397e35c6857807551429893eb5d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered test-infrastructure preparation with green exact-head checks and no supported correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes test infrastructure rather than user-visible product behavior; its submitted exact-head configuration and installed-Vitest-5 evidence is supplemental validation, not a contributor proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes test infrastructure rather than user-visible product behavior; its submitted exact-head configuration and installed-Vitest-5 evidence is supplemental validation, not a contributor proof gate.
Evidence reviewed 6 items Shared configuration owner: The shared test configuration now explicitly sets clearMocks to false, preserving calls recorded during shared setup and beforeAll hooks; the same module owns the helper that marks a complete inline project independent.
Inline-project coverage: Both inline-project owners apply the independence helper to every project, while the project bodies already compose their complete aliases, plugins, setup, and test settings.
Behavioral configuration assertions: The affected suites inspect emitted configuration: they assert false mock clearing, false inheritance for all four inline projects, unique selected files, and retained E2E ownership partitioning.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Vitest configuration feeds root and Control UI test projects used by local development and CI. These settings determine mock cleanup, project inheritance, and which configuration each validation project receives.

flowchart LR
  A[Shared test settings] --> B[Root and Control UI configs]
  C[Inline UI projects] --> D[Independent project setting]
  B --> E[Vitest project resolution]
  D --> E
  E --> F[Local and CI validation]
  F --> G[Deterministic test ownership]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +5, Tests +28. Total +33 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 6 1 +5
Tests 4 31 3 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 37 4 +33

Review metrics

Metric Value Why it matters
Production vs test-support LOC production +0, test support +33 All changed code is test configuration or configuration-contract coverage; no deployed runtime behavior changes.

Root-cause cluster

Relationship: partial_overlap
Canonical: #137201
Summary: This PR is a focused prerequisite for the broader Vitest 5 adoption and acceptance work, not a replacement for it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land this as the focused parity pin, while retaining full exact-Vitest-5 correctness and performance acceptance in #137201 and its migration PR.

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

Not applicable: this is preventative test-configuration work, and the changed configuration contracts are directly asserted by the focused suites.

Is this the best way to solve the issue?

Yes. The shared configuration owns mock cleanup, and the two inline project arrays own independence; path-based root projects are unaffected, so this is the narrowest maintainable location.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6df6ea5c693a.

Labels

Label changes:

  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is a bounded developer-validation compatibility preparation with no deployed product-runtime impact.
  • 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: This MEMBER-authored PR changes test infrastructure rather than user-visible product behavior; its submitted exact-head configuration and installed-Vitest-5 evidence is supplemental validation, not a contributor proof gate.

Evidence

What I checked:

  • Shared configuration owner: The shared test configuration now explicitly sets clearMocks to false, preserving calls recorded during shared setup and beforeAll hooks; the same module owns the helper that marks a complete inline project independent. (test/vitest/vitest.shared.config.ts:44, a669b2cb2ac2)
  • Inline-project coverage: Both inline-project owners apply the independence helper to every project, while the project bodies already compose their complete aliases, plugins, setup, and test settings. (test/vitest/vitest.ui-e2e.config.ts:145, a669b2cb2ac2)
  • Behavioral configuration assertions: The affected suites inspect emitted configuration: they assert false mock clearing, false inheritance for all four inline projects, unique selected files, and retained E2E ownership partitioning. (test/vitest-ui-e2e-config.test.ts:371, a669b2cb2ac2)
  • Current-main comparison: The fetched current-main revision still has Vitest 4.1.11 and lacks these explicit pins; its root suite references path-based project configs, so the change is limited to the two inline project arrays rather than all project loading. (ui/vitest.config.ts:206, 6df6ea5c693a)
  • Submitted validation: The PR discussion records an exact-head focused configuration suite, root/UI type checks, and an installed Vitest 5.0.0 run asserting both pins; the supplied exact-head CI rollup is green for the relevant test and check lanes. (a669b2cb2ac2)
  • Feature-history routing: Path history shows Peter Steinberger as a recent contributor to the shared and Control UI Vitest configuration surfaces; the current branch commit is Vincent Koc’s focused compatibility preparation. (test/vitest/vitest.shared.config.ts, 4ee565c6d2a2)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (2 earlier review cycles)
  • reviewed 2026-09-04T11:13:31.801Z sha a669b2c :: blocked before merge. :: none
  • reviewed 2026-09-04T11:53:48.866Z sha a669b2c :: blocked before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

Applied the ClawSweeper rank-up move with direct Vitest 5 contract evidence.

Vitest v5.0.0 is commit f441c6fab25e579c5b7dd3dd50538416f415fbae:

Exact OpenClaw head a669b2cb2ac20397e35c6857807551429893eb5d also passed the focused v4-compatible config suites (68 tests), root test types, UI types, formatting, git diff --check, and independent exact-diff autoreview with no findings.

An exact-v5 runtime and benchmark run is intentionally not added here because this preparatory PR has no dependency or lockfile change; that measured migration proof remains tracked by #137201.

@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper rank-up move satisfied with installed stable [email protected] proof.

  • dist/chunks/defaults.D2ip7f-X.js:50-59 sets clearMocks: true by default.
  • dist/chunks/index.B89dZ0-N.js:12735-12738 states that since Vitest 5 inline projects extend their declaring config by default and directs independent projects to use extends: false.
  • dist/chunks/index.B89dZ0-N.js:12838-12846 implements inheritsParentConfig = inline && options.extends !== false && typeof options.extends !== "string".
  • Exact v5 run on migration commit 0203a3908f6558e69f0af8f015b63d623ee95301: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run test/vitest-ui-package-config.test.ts passed 1 file and 12/12 tests (3.32s Vitest, 4.14s shard). Assertions cover clearMocks: false, extends: false on every inline project, and unique resource selection.

This directly verifies both semantic pins against the installed stable release; the branch remains unchanged at a669b2cb2ac20397e35c6857807551429893eb5d.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

The refreshed exact-head review lease started at 2026-09-04T11:20:29Z and expired at 2026-09-04T11:23:32Z without publishing its completed verdict. Head remains a669b2cb2ac20397e35c6857807551429893eb5d; exact-head CI remains green.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision: accept ClawSweeper's recommended option to land this isolated compatibility preparation now.

This PR does not claim the Vitest 5 dependency migration complete. Exact-Vitest-5 correctness and performance/benchmark acceptance remain mandatory on the canonical issue #137201 and migration PR #137202. No broader migration acceptance is being bypassed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 4, 2026
@vincentkoc
vincentkoc merged commit 00a7a12 into main Sep 4, 2026
175 of 184 checks passed
@vincentkoc
vincentkoc deleted the test/vitest5-config-parity branch September 4, 2026 12:07
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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