Skip to content

fix(ci): isolate Vitest cache warmer configs - #119381

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-cache-warmer-isolation
Aug 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-cache-warmer-isolation

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Related: https://github.com/openclaw/openclaw/actions/runs/30895638140

What Problem This Solves

Fixes the scheduled Vitest Cache Warm workflow failing after earlier configs passed because all selected configs ran inside one long-lived shard child. Config-global state and worker processes accumulated across nine configs until the final config exited unexpectedly.

Why This Change Was Made

The cache warmer now emits one named shard group per Vitest config and runs those groups with concurrency one. Each config gets a fresh child process, while the existing shard runner deliberately reuses the same serial persistent cache leaf so transforms from earlier configs remain warm.

The old aggregate OPENCLAW_NODE_TEST_CONFIGS_JSON path and misleading shared shard label are removed from this workflow. Normal pull-request, push, release, and shard aggregation behavior is unchanged.

Root cause: the scheduled workflow owned process isolation but encoded all configs as one child invocation.

Architectural owner: .github/workflows/vitest-cache-warm.yml, using the existing grouped-plan contract in scripts/ci-run-node-test-shard.mjs.

Canonical fix: isolate at the workflow's plan producer, not with retries, larger timeouts, weaker assertions, or a second cache path.

Production LOC: runtime production code +0/-0; workflow +5/-2; docs +1/-1; tests +92/-0.

User Impact

No product runtime behavior changes. Maintainers get a bounded daily cache warm run: one fresh child per config, one active config at a time, and one shared serial cache slot.

Evidence

  • node scripts/run-vitest.mjs test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts
    • 2 files passed
    • 110 tests passed, 1 skipped
  • git diff --check origin/main...HEAD
  • Merge-tree against current origin/main is conflict-free; touched paths were unchanged by branch drift.
  • Independent final review: no blocking findings.

AI-assisted: yes. The maintainer reviewed the implementation and validation evidence.

Punchcard-Session: amber-orchard-valley-s4

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels Aug 5, 2026
@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 00:12
Punchcard-Session: amber-orchard-valley-s4
@vincentkoc
vincentkoc force-pushed the fix/ci-cache-warmer-isolation branch from 7015fa0 to 5fd543c Compare August 5, 2026 00:55
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 5fd543cdfd276b583e224a16ca0aa7e100363af5. The head changed only to add an explicit missing-environment guard after check-test-types found the workflow-test value could be undefined.

@clawsweeper

clawsweeper Bot commented Aug 5, 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 repository_dispatch).
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 added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 9:09 PM ET / August 5, 2026, 01:09 UTC.

ClawSweeper review

What this changes

The PR changes the scheduled Vitest cache warmer to create one serial test group per selected configuration while retaining its shared transform-cache slot.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review. Current main still sends all selected cache-warm configurations as one runner plan, whereas the PR uses the runner’s existing grouped-plan contract to launch one serial child per configuration; no concrete patch defect was found.

Priority: P3
Reviewed head: 5fd543cdfd276b583e224a16ca0aa7e100363af5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch matches the existing grouped-plan boundary and is covered by targeted plan and workflow assertions.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI-only PR is exempt from the external-contributor real-behavior-proof gate; its focused workflow and runner test evidence remains relevant supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI-only PR is exempt from the external-contributor real-behavior-proof gate; its focused workflow and runner test evidence remains relevant supplemental validation.
Evidence reviewed 5 items Current-main behavior: The cache-warmer currently exports all selected configurations through one aggregate config variable and one shard label; the shard runner converts that into one group, so the selected configurations share one child invocation.
Existing grouped-plan contract: The runner prefers nonempty grouped plans over the legacy aggregate envelope, then schedules each group as a separate child; serial concurrency reuses cache slot zero.
Sibling workflow use: The main CI workflow already supplies grouped plans to this runner, so the PR reuses the established plan boundary rather than adding a second runner path.
Findings None None.
Security None None.

How this fits together

The scheduled cache-warmer workflow selects broad Vitest configurations and passes a plan to the Node shard runner. The runner launches child test processes and assigns their cache directories, affecting the reliability and reuse of CI’s protected test cache.

flowchart LR
  A[Scheduled cache warmer] --> B[Select test configurations]
  B --> C[Build one group per configuration]
  C --> D[Node shard runner]
  D --> E[Fresh serial Vitest child]
  E --> F[Shared transform-cache slot]
Loading

Before merge

  • Resolve merge risk (P1) - This changes scheduled CI child-process lifecycle; confirm the exact head’s remaining required checks and the next cache-warm dispatch complete within the existing 30-minute budget.
  • Complete next step (P2) - This maintainer-authored PR has a protected maintainer label and needs normal exact-head CI completion and owner review; no mechanical repair is indicated.
Agent review details

Security

None.

PR surface

Tests +96, Docs 0, Config +3. Total +99 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 96 0 +96
Docs 1 1 1 0
Config 1 5 2 +3
Generated 0 0 0 0
Other 0 0 0 0
Total 4 102 3 +99

Review metrics

Metric Value Why it matters
Production vs test delta workflow +5/-2, docs +1/-1, tests +96/-0 The production change is confined to the CI plan producer, while regression coverage exercises both plan generation and serial cache-slot behavior.

Stored data model

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

Merge-risk options

Maintainer options:

  1. Land after exact-head CI completes (recommended)
    Retain the grouped-plan implementation once the remaining exact-head checks complete, then observe the next scheduled or dispatched cache warm for the intended isolated children.
  2. Require a cache-warm dispatch first
    Pause merge until a manually dispatched cache-warm run demonstrates the serial per-configuration execution in GitHub Actions logs.

Technical review

Best possible solution:

Use the existing grouped-plan interface at the cache-warmer workflow boundary so each configuration receives a fresh serial child while cache reuse remains confined to the established persistent slot.

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

Yes, from source: current main aggregates the selected configurations into one runner group, while the runner executes each group as one child; the scheduled failure itself was not rerun locally.

Is this the best way to solve the issue?

Yes. The workflow is the plan producer and the existing grouped-plan runner already supplies the required process-isolation behavior, avoiding retries or a parallel cache path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 618fba92bf01.

Labels

Label changes:

  • add merge-risk: 🚨 automation: The patch changes the scheduled workflow’s test-plan shape and child-process behavior after merge.

Label justifications:

  • P3: This is bounded CI reliability maintenance with no product-runtime behavior change.
  • merge-risk: 🚨 automation: The patch changes the scheduled workflow’s test-plan shape and child-process behavior after merge.
  • 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 maintainer-authored CI-only PR is exempt from the external-contributor real-behavior-proof gate; its focused workflow and runner test evidence remains relevant supplemental validation.

Evidence

What I checked:

  • Current-main behavior: The cache-warmer currently exports all selected configurations through one aggregate config variable and one shard label; the shard runner converts that into one group, so the selected configurations share one child invocation. (.github/workflows/vitest-cache-warm.yml:75, 618fba92bf01)
  • Existing grouped-plan contract: The runner prefers nonempty grouped plans over the legacy aggregate envelope, then schedules each group as a separate child; serial concurrency reuses cache slot zero. (scripts/ci-run-node-test-shard.mjs:53, 618fba92bf01)
  • Sibling workflow use: The main CI workflow already supplies grouped plans to this runner, so the PR reuses the established plan boundary rather than adding a second runner path. (.github/workflows/ci.yml:2123, 618fba92bf01)
  • Feature provenance: Workflow history identifies commit 2ba272b as the prior cache-warm graph work, connecting the likely owner to this planning surface. (.github/workflows/vitest-cache-warm.yml:40, 2ba272bda686)
  • Exact-head limitation: The supplied PR patch and CI context were reviewed, but this partial checkout could not hydrate the PR object because github.com DNS resolution failed; current-main source and history were inspected locally. (5fd543cdfd27)

Likely related people:

  • steipete: History identifies Peter Steinberger’s cache-warm graph commit as the central earlier implementation on this workflow surface. (role: cache-warm workflow introducer; confidence: high; commits: 2ba272bda686; files: .github/workflows/vitest-cache-warm.yml)
  • shakkernerd: The most recent locally available workflow-history entry is a change to the same cache-warmer workflow. (role: recent adjacent workflow contributor; confidence: medium; commits: 770c1202ecf2; files: .github/workflows/vitest-cache-warm.yml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the remaining exact-head checks to complete, then verify the next scheduled or dispatched cache-warm run.

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 (1 earlier review cycle)
  • reviewed 2026-08-05T01:03:55.249Z sha 5fd543c :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 5, 2026
@vincentkoc
vincentkoc merged commit 8f2850d into main Aug 5, 2026
113 of 114 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-cache-warmer-isolation branch August 5, 2026 01:12
vincentkoc added a commit that referenced this pull request Aug 5, 2026
…time

* origin/main:
  fix(ui): clear split-pane questions after answers and cancellations (#118787)
  fix(slack): authorize reaction and message reads before applying limits (#118736)
  fix(ci): isolate cache warmer configs (#119381)
  fix(slack): Fix bad escaping in slack tool commentary (#119373)
  feat(audit): add execution identity inspection (#117034)
  fix(fs): adopt fs-safe 0.5.2 untrusted filename sanitization (#119363)
  fix(ci): preserve release evidence across reruns (#119380)
  fix(telegram): keep commands responsive during Codex login
  perf(memory): defer session backfill runtime (#119372)
  fix(ci): isolate built TUI PTY fixture (#119339)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Punchcard-Session: amber-orchard-valley-s4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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