Repository navigation
ci: reuse verified test workers across jobs - #154095
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 6:12 PM ET / 22:12 UTC (Revision 2). ClawSweeper reviewWhat this changesEligible Linux CI jobs restore verified compiled test workers from the existing cache warmer, while unused build-archive uploads are removed. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful CI optimization absent from current main. The pinned patch has no actionable correctness findings, and the supplied evidence distinguishes demonstrated worker reuse from unmeasured workflow savings. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's CI prepares compiled workers before running selected tests. The shared cache supplies candidate compiler outputs; the existing worker owner validates them and either reuses them or compiles fresh outputs. flowchart TD
A[Protected cache warmer] --> B[Compiled worker archive]
B --> C[Eligible Linux test job]
C --> D{Inputs and outputs match?}
D -->|Yes| E[Reuse reserved worker generation]
D -->|No| F[Compile fresh workers]
E --> G[Run tests and join cleanup]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +110, Docs +63, Config +25, Other +43. Total +241 across 13 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one verified worker-cache owner with fresh-compilation fallback, and assess net CI savings from warm production observations after rollout. Do we have a high-confidence way to reproduce the issue? Not applicable as a product bug: source confirms repeated CI compilation, and the supplied paired Linux probe measures the preparation overhead. Is this the best way to solve the issue? Yes: extending the existing verified cache and lifecycle owner avoids duplicate compilation machinery while preserving fresh preparation for incompatible inputs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2c6626c6183e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
CI repeatedly compiles the same test workers in separate jobs and uploads build archives that no repository job consumes.
Related: #153558.
User Impact
This reduces CI preparation work without changing test selection, worker limits, runner placement, or deadlines. There is no product behavior change. The first PR run is cold: shared reuse becomes available only after the protected warmer publishes this new cache namespace.
Why This Change Was Made
Source-only Linux Node 24 shards restore the existing content-validated worker cache. The protected warmer prepares and joins one generation before SDK/runtime builds change package resolution, then publishes it through the existing Actions cache mechanism. PR consumers remain restore-only. Missing seeds keep normal fresh compilation; incompatible source, dependencies, compiler, environment, resolution topology, workspace paths, or output bytes cause a local rebuild. The existing owner retains exclusive slot reservation, borrower verification, and joined cleanup.
Remove the unused
dist-runtime-buildandbundled-plugin-assetspacking/uploads. Built CLI smoke, generated asset checks, all built-artifact verifiers, and diagnostic/proof uploads remain. Runtime-building shards retain their ownqaRuntimepreparation: depending on the full artifact job would add SDK/UI/check work to their critical path, and private QA uses a different output variant. Checkout already fetches depth-one selected source; history readers retain their explicit prerequisites. Sampled dependency/store keys hit, so this change does not churn those keys. Docker/desktop proof steps were unselected in the baselines and are not treated as removable overhead.Evidence
Both job pages were fetched explicitly for each baseline and checked against
total_count. Skipped steps are excluded; successful zero-second steps remain. Median is the arithmetic median; p90 is nearest rank. API timing resolution is one second. Composite Node setup includes runtime, pnpm/dependency restore/install, and compile-cache preparation. Worker compilation is inside the Node test step, not a separate API step. The critical worker below is the last finishing active non-gate job; run wall includes admission/dependency/final-gate delay.Baseline main: 35520044205, head
814c3c1ae9650edc8c38ed306da8df4681144c4b, 72 active/90 total jobs, 16m45s wall, 412.42 machine-minutes. Critical workerchecks-node-compact-large-10took 907s; checkout/setup consumed 74s (8.16%).Baseline PR: 35456568835, head
3d4234216e859be9a2a1e3b81af81db8381e90e6, 152 active/168 total jobs, 26m25s wall, 754.13 machine-minutes. Critical workerchecks-node-compact-large-19took 1,327s; checkout/setup consumed 47s (3.54%). This inventory differs from main and the candidate; aggregate wall differences are not a paired causal benchmark.The five exposed fixed costs are checkout, Node setup, runtime builds, runner setup, and dist build. Main/PR runtime builds consumed 3.10/12.32 minutes; dist build took 81/80s. Sampled exact-dependency/store restores hit; cold worker compilation was 7.149–21.746s. No desktop/Docker timing claim is possible from these skipped lanes.
Linux Testbox
tbx_01m309pm522sbfeja1v3jr36b4(provisioning run) used 4 CPUs, 15.4 GiB RAM, Node 24.19.0. A paired preparation probe, including owner disposal, measured fresh 8.43/9.44s versus archive-restored 3.21/3.17s. A 30 MiB archive was packed, removed, and extracted before the first reuse. Peak process RSS was 2.59–2.66 GiB fresh versus 0.55 GiB restored; cold seed production took 9.38s. Gross midpoint improvement is 5.75s per matching consumer before transport. For 41 source-only main shards, the upper-bound gross saving is 3.93 machine-minutes/run, or 2.36 machine-hours per eight hours at 36 runs; subtract seed production, transport and misses. This is a forecast, not a measured workflow saving. Removing unused uploads saves the measured 5–6s runtime upload plus packing/plugin-asset upload on the artifact job, which was not either baseline's final bottleneck.The initial remote cache/slot run caught a fixture inheriting the new opt-in while asserting default CI behavior. The fixture now pins default CI explicitly and independently covers cached-CI slot reuse; no assertion or deadline was relaxed.
Validation completed before publication:
pnpm test test/scripts/vitest-worker-cache.test.ts --maxWorkers=1passed 24 tests, 7.55s wall (3.2s test body). The slot file passed four cases in 4.39s wrapper wall.node scripts/check-changed.mjs, workflow audit (zizmorand generated checkout checks),oxfmt --check, docs inventory, 14,232 internal links, touched-page anchors, andgit diff --checkpassed.8d8ab7b216f0ae423b09af2b6267d185c2e1989e. The first candidate CI run passed, including the aggregate gate; the completed comparison follows below.The removed packing/upload steps totaled 7s on main / 8s on the PR (packing rounded to zero at API resolution, runtime upload 5/6s, plugin assets 2s). These are artifact-job savings, not measured workflow-wall reductions.
First PR run: measured result
CI run 35539043850 passed on
8d8ab7b216f0ae423b09af2b6267d185c2e1989e: 17m26s wall, 67 active / 76 total jobs, 282.30 machine-minutes. All PR check-rollup entries are successful, neutral, or intentionally skipped. The PR remains open and unmerged.The raw differences from the baseline PR are −8m59s workflow wall and −471.83 machine-minutes. They are not attributable savings: the candidate selected 14 Node shards rather than 120, and selected browser/Docker coverage absent from that baseline. Compared with the main baseline, wall is +41s. No measured critical-path improvement is established by this cold run.
The finishing worker was
checks-windows-node-test-2: 877s wall, beginning 164s after workflow creation. Its test step took 808s (92.13%); checkout was 21s (2.39%) and dependency installation 28s (3.19%). It does not use the Linux worker cache.Both inspected candidate Node logs confirmed a miss in the new worker-cache namespace. Lookup took 0.114/0.141s; fresh compilation remained in use. Warm CI transfer time and production hit rate remain unmeasured until the protected main warmer rolls out. The native 5.75s gross per-hit saving is therefore a forecast input, not a claimed PR-wide saving.
The selected Docker owner proof took 636s, the real-Gateway runtime/UI build 102s, desktop resize proof 79s, and each of the two desktop proof uploads 2s. Those are retained coverage/proof work, not unused outputs.
CI reported case-duration sums of 129.639s for the workflow guard file, 1.315s for the cache file, and 0.559s for the slot file. These are verbose-case sums, not full file walls. The new workflow admission case took 20ms, the cache opt-in case 0ms at reporter resolution, and the cached-CI slot case 63ms. The first candidate run was green without rerunning any job.