Skip to content

improve(ci): cut hosted test import time with warm caches - #123465

Merged
steipete merged 2 commits into
mainfrom
steipete/fs-cache-all-lanes
Aug 14, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fs-cache-all-lanes

Conversation

@steipete

@steipete steipete commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

GitHub-hosted outage-mode CI had a warm Vitest transform cache and test-scope Node compile cache, but only the checks-node-* matrix restored them. Other Vitest-running Linux lanes repeated cold import/transform work against the same immutable protected cache generation.

Why This Change Was Made

The shared setup action now exposes one default-off, restore-only restore-test-caches input that enables both existing reader paths without changing either key family. GitHub backend routing flips that input only at audited Linux Vitest call sites; mixed checks-fast-core rows are task-gated so non-Vitest checks do not pay restore cost. Blacksmith behavior is unchanged, and the existing elected Node shard plus the warmer remain the only transform-cache writers.

This is AI-assisted work, reviewed with the repository autoreview workflow.

User Impact

There is no product behavior change. Hosted CI lanes can reuse transform and orchestration bytecode instead of independently paying cold import cost, reducing outage-mode feedback time while every newly added consumer remains restore-only.

The tradeoff is explicit: the pruned transform archive can reach 2 GiB. At roughly 125 MB/s, restoring it costs about 16.4 seconds, or 15–20 seconds with overhead. Actual hosted contract-lane measurements show roughly 21 seconds of transform work against roughly 8 seconds of restore cost, while broader cold Vitest imports reached 99.52–142.93 seconds. The single default-off input keeps rollback localized if measured savings fall below restore cost.

Evidence

Hosted cache wiring audit

Lane or task Result Concrete reason
checks-node-* test shards Wired Existing explicit Vitest transform and test-scope compile cache readers remain unchanged; one elected shard retains the only in-run save input.
checks-ui Wired Runs the Control UI Vitest suite and inherits both cache environments from setup-node-env.
Ordinary sharded checks-ui-e2e Wired Runs the UI E2E and browser-extension Vitest paths; all new consumers remain restore-only.
check-sqlite-session-lifecycle Wired Calls setup-node-env, then scripts/run-vitest.mjs for the built-CLI lifecycle proof.
checks-fast-plugin-contracts-* Wired Calls pnpm test:contracts:plugins, which routes through scripts/run-vitest.mjs. Audit measured about 21 seconds of transform work versus about 8 seconds of restore.
checks-fast-channel-contracts-* Wired Calls pnpm test:contracts:channels, which routes through scripts/test-projects.mts and preserves the filesystem cache environment.
checks-fast-core: bundled-protocol, contracts-plugins-ci-routing, ci-routing, bun-launcher Wired, task-gated Each task invokes Vitest through the repository wrappers; the composite input is true only for these rows in GitHub mode.
checks-fast-core: coercion-helpers, max-lines-ratchet Skipped These rows run static checks, not Vitest, so restoring the transform archive would be pure overhead.
native-i18n Skipped Runs scripts/native-app-i18n.ts inventory/parity commands and never invokes Vitest.
control-ui-i18n Skipped Runs scripts/control-ui-i18n*.ts verification/parity commands and never invokes Vitest.
checks-ui-e2e-real-gateway Skipped Runs only two explicitly targeted Vitest files; no audit timing showed transform savings above the archive restore cost.
build-artifacts Skipped Owns the separate build compile-cache namespace and writer policy; the combined test-cache input would not restore the required test-scope namespace.
macOS and Windows test lanes Skipped Cache keys are OS-specific; the protected warmer produces Linux archives, and the composite action disables these caches on Windows.

Validation

  • Before the follow-up wiring, the expanded guard failed at sqlite-session-lifecycle because the input was absent; it passed after the workflow change.
  • node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts — 120 passed, 2 skipped.
  • node --import tsx scripts/check-workflows.mts — passed zizmor and reported no direct composite run-block input interpolation.
  • ./node_modules/.bin/oxfmt --check .github/workflows/ci.yml docs/ci.md test/scripts/ci-workflow-guards.test.ts — passed.
  • node scripts/docs-list.js and git diff --check — passed.
  • Autoreview: clean, no accepted or actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Aug 14, 2026
@steipete
steipete marked this pull request as ready for review August 14, 2026 04:43
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 14, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 1:28 AM ET / 05:28 UTC.

ClawSweeper review

What this changes

The PR adds a default-off shared CI setup input so selected GitHub-hosted Linux Vitest lanes restore existing transform and test-scope Node compile caches.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this maintainer-authored, maintainer-labeled CI improvement open for exact-head workflow completion and human review. The supplied diff and prior review show a focused cache-reader expansion, but sandbox failure prevented the required source, history, scoped-policy, and current-main inspection.

Priority: P3
Reviewed head: 0e9476ba5eca573bac31eb790ac323d0bff19619
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The submitted validation and focused diff are useful, but independent source inspection and exact-head workflow completion remain outstanding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI-only PR is assessed through exact-head workflow results rather than the external-contributor real-behavior-proof gate.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI-only PR is assessed through exact-head workflow results rather than the external-contributor real-behavior-proof gate.
Evidence reviewed 4 items Submitted patch scope: The supplied PR diff adds a default-false restore-test-caches action input and wires hosted Linux workflow jobs to it; the test update asserts the default and expected call sites.
Prior review continuity: The prior ClawSweeper review at the same head found no discrete patch defect and requested exact-head CI plus validation that the cache writer/reader split remains intact.
Inspection infrastructure: The required read-only repository command failed before returning filesystem output: bwrap could not create a loopback address. Consequently, source, history, scoped AGENTS.md, and skill instructions could not be independently inspected.
Findings None None.
Security None None.

How this fits together

OpenClaw’s shared CI setup action prepares Node and cache state for workflow jobs. Selected Linux test jobs pass an input to that action, which decides whether existing cache readers are enabled before Vitest runs.

flowchart LR
  A[Hosted CI job] --> B[Shared Node setup]
  B --> C{Restore test caches enabled?}
  C -->|Yes| D[Restore transform cache]
  C -->|Yes| E[Restore Node compile cache]
  C -->|No| F[Cold test startup]
  D --> G[Vitest test run]
  E --> G
Loading

Decision needed

Question Recommendation
After exact-head CI completes, should the maintainer accept the hosted-only cache-reader expansion with the existing writer policy unchanged? Merge after successful exact-head verification: Accept the change if exact-head CI and cache behavior confirm that only intended hosted Vitest consumers restore the existing caches.

Why: The PR is maintainer-authored and maintainer-labeled, while the changed shared action governs CI cache behavior across many jobs.

Before merge

  • Resolve merge risk (P1) - The shared composite action changes cache restoration across additional hosted jobs; exact-head CI must confirm that readers are added without changing the elected cache-writer policy or causing restore overhead in non-Vitest paths.
  • Resolve merge risk (P1) - The sandbox prevented independent inspection of the full workflow, action, history, tests, and applicable scoped policy.
Agent review details

Security

None.

PR surface

Tests +104, Docs 0, Config +10. Total +114 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 106 2 +104
Docs 1 2 2 0
Config 2 15 5 +10
Generated 0 0 0 0
Other 0 0 0 0
Total 4 123 9 +114

Review metrics

Metric Value Why it matters
Production vs test delta production +10, tests +104 The supplied diff adds shared CI routing and documentation plus focused workflow-guard coverage; the production portion changes automation behavior.

Stored data model

Persistent data-model change detected: persistent cache schema: .github/actions/setup-node-env/action.yml. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify cache invariants before merge (recommended)
    Require exact-head hosted results that show selected consumers restore caches while the existing elected writer remains the sole writer.
  2. Accept the measured restore tradeoff
    Maintainers may accept the added restore time if the hosted measurements continue to beat the cold transform cost.

Technical review

Best possible solution:

Land only after exact-head hosted CI confirms the selected jobs are restore-only consumers and a maintainer verifies that the writer election and backend-specific cache behavior remain unchanged.

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

Not applicable: this is CI performance work, so the relevant proof is exact-head hosted workflow behavior and timing rather than a user-facing bug reproduction.

Is this the best way to solve the issue?

Unclear: the proposed shared input appears to preserve a single reader path, but full source and workflow inspection was blocked before that architecture could be independently compared with current alternatives.

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

Codex review notes: model internal, reasoning high; reviewed against 1ea149910703.

Labels

Label justifications:

  • P3: This is an internal CI performance improvement with no stated product-runtime behavior change.
  • merge-risk: 🚨 automation: The shared CI setup action changes cache restoration conditions for multiple hosted test jobs.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • 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 assessed through exact-head workflow results rather than the external-contributor real-behavior-proof gate.

Evidence

What I checked:

  • Submitted patch scope: The supplied PR diff adds a default-false restore-test-caches action input and wires hosted Linux workflow jobs to it; the test update asserts the default and expected call sites. (.github/actions/setup-node-env/action.yml:43, 0e9476ba5eca)
  • Prior review continuity: The prior ClawSweeper review at the same head found no discrete patch defect and requested exact-head CI plus validation that the cache writer/reader split remains intact. (0e9476ba5eca)
  • Inspection infrastructure: The required read-only repository command failed before returning filesystem output: bwrap could not create a loopback address. Consequently, source, history, scoped AGENTS.md, and skill instructions could not be independently inspected.
  • Workflow status: The supplied check state shows the relevant exact-head workflow is still incomplete, with many CI jobs queued or in progress. (.github/workflows/ci.yml:1505, 0e9476ba5eca)

Likely related people:

  • steipete: The supplied context identifies steipete as the member author of both commits and the maintainer-labeled CI change; repository history could not be inspected to establish broader area ownership. (role: proposed change owner; confidence: medium; commits: 971cacb3cf98, 0e9476ba5eca; files: .github/actions/setup-node-env/action.yml, .github/workflows/ci.yml, test/scripts/ci-workflow-guards.test.ts)

Rank-up moves

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

  • Wait for exact-head CI to complete and confirm the cache reader/writer invariant in the resulting workflow logs.

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-14T05:11:20.138Z sha 0e9476b :: needs maintainer review before merge. :: none

@steipete steipete closed this Aug 14, 2026
@steipete steipete reopened this Aug 14, 2026
@steipete
steipete merged commit 1400049 into main Aug 14, 2026
306 of 309 checks passed
@steipete
steipete deleted the steipete/fs-cache-all-lanes branch August 14, 2026 05:41
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…23465)

* perf(ci): restore hosted test caches across lanes

* perf(ci): restore caches in remaining Vitest lanes
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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