Skip to content

improve(ci): warm import-heavy Vitest graphs - #110557

Merged
steipete merged 2 commits into
mainfrom
codex/expand-vitest-cache-seed
Jul 18, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/expand-vitest-cache-seed

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a CI performance problem where the protected Vitest transform archive restored successfully but omitted several import-heavy graphs. Those groups still paid cold transform/import work on every run, masking the cache rollout's broader benefit.

Why This Change Was Made

The trusted warmer now includes the whole configs that own agentic-gateway-methods, agentic-agents-embedded, and auto-reply-reply-commands-3, while preserving the existing unit-fast seed and fail-fast plan checks. The shard runner also clones a restored seed into each isolated cache lane before concurrent workers start, preserving the no-shared-writer invariant if plan concurrency is used again. Shard planning and ci.yml remain unchanged.

User Impact

No product behavior changes. CI should reuse transforms across more representative Node test groups without introducing concurrent Vitest cache writers.

Evidence

Measured protected-cache reader 29635747197, job 88057839992, still showed cold work in the newly seeded groups:

Group Wall Transform Import
agentic-gateway-methods 39.47s 23.09s 35.20s
agentic-agents-embedded 37.85s 23.58s 27.76s
auto-reply-reply-commands-3 7.63s 14.22s 18.81s

Local proof:

  • node scripts/run-vitest.mjs test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts — 96 passed, 1 skipped
  • git diff --check — clean
  • autoreview — clean after preserving the separate core-unit-fast seed invariant

Post-merge proof will dispatch the protected warmer, record archive size/wall time, then compare these exact groups on subsequent main readers and check for ENOTEMPTY, restore, or save errors.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c6fdd2c02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// bound graphs that remained cold in measured protected-cache readers.
const additionalShardNames = new Set([
"agentic-agents-embedded",
"agentic-gateway-methods",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the gateway-methods worker pin

When this warmer adds agentic-gateway-methods, it loads the base shard descriptors and later exports only configs, so the compact CI metadata that pins this group to OPENCLAW_VITEST_MAX_WORKERS=2 is lost (scripts/lib/ci-node-test-plan.mjs documents agentic-gateway-(?:core|methods) as flaking at higher worker counts). The warmer has no separate resource step, and Vitest's shared CI default is 3 workers, so scheduled/protected cache warming can now run the gateway-methods suite in the exact unpinned mode the main CI plan avoids; carry the compact group env through or set the worker pin for this seed.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/expand-vitest-cache-seed branch from 3c6fdd2 to 7353674 Compare July 18, 2026 08:12
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 4:14 AM ET / 08:14 UTC.

Summary
The branch expands the Vitest cache warmer to seed three import-heavy shard configurations and clones the restored seed into isolated cache slots before concurrent shard workers run.

PR surface: Tests +22, Config +19, Other +42. Total +83 across 5 files.

Reproducibility: yes. from source: compare the selected warmer descriptors with the shard-plan worker metadata for agentic-gateway-methods; a real protected-cache run has not yet been supplied to confirm the runtime effect.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: persistent cache schema: .github/workflows/vitest-cache-warm.yml, persistent cache schema: scripts/ci-run-node-test-shard.mjs, persistent cache schema: test/scripts/ci-run-node-test-shard.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Preserve and test the agentic-gateway-methods two-worker cap in the warmer.
  • Attach redacted protected-warmer output and a subsequent reader comparison for the three newly seeded graphs.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Focused tests and pre-change reader timings are useful supplemental evidence, but no after-fix protected-warmer and reader result demonstrates the changed cache path; attach redacted live output after correcting the worker cap. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The scheduled/protected warmer may execute agentic-gateway-methods above its established two-worker cap, reintroducing the flaky or resource-sensitive mode the normal shard plan avoids.
  • [P1] The intended cache-speedup result remains unproven on a real protected warmer followed by a cache-reading CI job; cloning also needs that path checked for restore/save or filesystem errors.

Maintainer options:

  1. Preserve the gateway-methods worker cap (recommended)
    Pass the descriptor's two-worker setting into the warmer or seed that graph in a dedicated capped invocation, then add a focused guard test.
  2. Pause the cache expansion
    Keep the existing unit-fast-only seed if the warmer cannot represent per-shard execution constraints without introducing conflicting CI policy.

Next step before merge

  • [P1] This PR carries the protected maintainer label, so the mechanical correction and live CI proof should remain under explicit maintainer handling.

Security
Cleared: The patch changes repository CI cache handling only and introduces no new dependency source, secret access, permission change, or third-party code-execution path.

Review findings

  • [P2] Preserve the gateway-methods worker pin — .github/workflows/vitest-cache-warm.yml:45
Review details

Best possible solution:

Keep the shard-level worker constraint when warming agentic-gateway-methods, cover that invariant in the workflow guard, then attach redacted protected-warmer and subsequent-reader evidence showing the added graphs reuse the seed without cache errors.

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

Yes, from source: compare the selected warmer descriptors with the shard-plan worker metadata for agentic-gateway-methods; a real protected-cache run has not yet been supplied to confirm the runtime effect.

Is this the best way to solve the issue?

No. Expanding the seed is reasonable, but the current path discards the selected shard's execution constraint; preserving that constraint is the narrower maintainable fix.

Full review comments:

  • [P2] Preserve the gateway-methods worker pin — .github/workflows/vitest-cache-warm.yml:45
    The warmer now selects agentic-gateway-methods but exports only its configs, discarding the shard metadata that pins this group to two workers. The protected warmer can therefore run this known resource-sensitive suite with the broader default worker count; carry the cap through or run this seed separately with the pinned setting.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 34440523cd03.

Label changes

Label changes:

  • add P3: This is a contained CI-performance and reliability improvement with no stated product-runtime impact.
  • add merge-risk: 🚨 automation: The patch changes scheduled/protected cache-warming execution and can bypass an existing shard worker-safety constraint.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused tests and pre-change reader timings are useful supplemental evidence, but no after-fix protected-warmer and reader result demonstrates the changed cache path; attach redacted live output after correcting the worker cap. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a contained CI-performance and reliability improvement with no stated product-runtime impact.
  • merge-risk: 🚨 automation: The patch changes scheduled/protected cache-warming execution and can bypass an existing shard worker-safety constraint.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused tests and pre-change reader timings are useful supplemental evidence, but no after-fix protected-warmer and reader result demonstrates the changed cache path; attach redacted live output after correcting the worker cap. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Tests +22, Config +19, Other +42. Total +83 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 22 0 +22
Docs 0 0 0 0
Config 1 23 4 +19
Generated 0 0 0 0
Other 2 43 1 +42
Total 5 88 5 +83

What I checked:

  • Unresolved CI worker constraint: The added warmer selection reduces shard descriptors to configs; the reviewed agentic-gateway-methods descriptor carries a worker cap that is not propagated into the warm command, so this suite can run with the warmer's broader default worker setting. (.github/workflows/vitest-cache-warm.yml:45, 7353674aa998)
  • Existing review feedback remains applicable: The recorded review identifies agentic-gateway-methods as pinned to two Vitest workers in the shard-plan metadata and explains that the warmer now bypasses that setting; the later branch commit only declares the cache-slot helper and does not address the workflow selection. (scripts/lib/ci-node-test-plan.mjs, 7353674aa998)
  • Proof is pre-change or mock-level: The PR body reports focused unit tests and measurements from a protected-cache reader, but says the relevant post-merge warmer and subsequent-reader comparison will happen later; it does not show an after-fix warmer run with the added graphs. (.github/workflows/vitest-cache-warm.yml, 7353674aa998)

Likely related people:

  • steipete: Authored both commits in the current branch that broaden the Vitest seed and add cache-slot cloning; current-main ownership history could not be independently inspected in this read-only review environment. (role: recent CI-cache contributor; confidence: low; commits: a0ccccbd6083, 7353674aa998; files: .github/workflows/vitest-cache-warm.yml, scripts/ci-run-node-test-shard.mjs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@steipete
steipete merged commit 2ba272b into main Jul 18, 2026
134 of 137 checks passed
@steipete
steipete deleted the codex/expand-vitest-cache-seed branch July 18, 2026 08:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Post-merge production measurement

The broad seed saved by warmer run 29637315250 restored successfully in two subsequent full main readers. Both CI runs completed successfully:

Shard Before broad seed Reader 1 Reader 2 Warm average Change
agentic-gateway-methods 39.47s 30.18s 30.51s 30.35s -23.1%
agentic-agents-embedded 37.85s 29.21s 27.91s 28.56s -24.5%
auto-reply-reply-commands-3 7.63s 4.00s 3.73s 3.87s -49.3%

Every measured job restored the same broad Vitest seed (127,117,038 compressed bytes) and Node compile seed (9,326,093 compressed bytes). No ENOTEMPTY, HTTP 429, cache restore/save failure, or cache-race signature appeared. The broad warmer's logical Vitest cache is 504,678,424 bytes, below the existing 2 GiB cap.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 19, 2026
* perf(ci): broaden Vitest transform cache seed

* fix(ci): declare cache slot clone helper
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* perf(ci): broaden Vitest transform cache seed

* fix(ci): declare cache slot clone helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant