Skip to content

fix(ci): keep worker builds sequential and release input snapshots - #199560

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-shutdown-worker-cache-20261112
Nov 16, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-shutdown-worker-cache-20261112

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Cache-enabled CI worker compilation can overlap two large build graphs, and live worker-cache handles retain input snapshots after their metadata has been prepared.

User Impact

Internal CI/tooling fix: CI worker builds stay sequential, and completed cache input snapshots can be collected while cache handles remain usable. Large-host local parallel builds remain supported. No user-facing configuration, migration, or action is required.

Why This Change Was Made

The compiler used cache enablement as a proxy for allowing parallel builds. The existing isCiLikeEnv policy now preserves sequential CI builds without removing the intentional local optimization. The cache factory now constructs CompilerInputSnapshot inside its existing memoized metadata initializer, so long-lived cache methods retain the prepared metadata rather than the snapshot.

The proposed shutdown-check cache opt-in and its workflow assertion were removed after complete fixed-cohort measurements failed memory and cold-start acceptance. This PR does not enable that opt-in or claim a measured performance win. Cache input hashes, namespaces, verification, and retention policy are unchanged.

Production delta is +8 lines: the CI resource-contract guard and its explanation, plus the cache-owner lifetime clarification. Tests cover CI, GitHub-Actions-only environments, local overlap and failure joining, and real cache miss/seal/restore lifetimes.

Evidence

  • Scheduling regression: the baseline overlapped CI graphs; the guarded implementation passes. A deliberate early-rejecting Promise.all mutation fails the local failure-boundary join assertion.
  • Retention regression: the old implementation retained both prepared snapshots; the fixed implementation releases both under the existing eight-pass GC/control proof. Both miss and hit handles remain usable, seals agree, and each snapshot is captured once.
  • Focused owner/cache/input/lifecycle/scheduling proof: 54 tests across 4 files passed.
  • Native delegated checks: both tsconfig.scripts.json and test/tsconfig/tsconfig.test.root.tooling.json passed; production lint passed. The overall native invocation exited 1 on one test-support typescript/unbound-method diagnostic. A justified explicit-receiver annotation was added, then affected-file lint and format passed. No executable code changed in that correction; git diff --check passed.
  • Local ClawSweeper was unavailable because its runner checkout contained unrelated changes. One local autoreview covered the reduced seven-file snapshot against bf5a454465517f4489c246a6c308bdec20c9c70f at P2 priority. It returned one finding, not a clean verdict: it requested a cache opt-in in the retention child. Independent source review rejected that premise: direct factory admission is the reserved-slot check in scripts/lib/vitest-worker-cache.mts:191, while environment opt-in belongs to callers at scripts/lib/vitest-worker-compiler.mts:53 and scripts/lib/vitest-worker-run.mts:24. Adding caller policy to this direct owner test would obscure its purpose. The final annotation-only change was independently checked against the reviewed bytes.
  • Exact head db5895bf0079682eb09206ddfecac0df0f70f4b6: the CI gate and published CI, dependency-review and security-sensitive-review statuses are SUCCESS. The full ClawSweeper review covers this head with zero findings, Before merge: None, and no Rank-up moves; the single manual request is Complete. Its readiness is advisory maintainer review, not a measured performance claim.
  • Native landing admission resolved. Disk capacity recovered, and the canonical PR workspace was provisioned through the native owner. Independently reviewed native recovery reconciled device-number drift in the shared dependency ledger while preserving all installations and holds. Exact-head review artifacts validated and GitHub-backed preparation completed at unchanged head db5895bf0079682eb09206ddfecac0df0f70f4b6; no rebase or source push was needed.

Keep cache-enabled CI builds sequential while preserving parallel builds on large local hosts. Release completed input snapshots after memoized cache metadata is prepared.

Cover actual compiler scheduling and cache miss/hit retention with owned child lifetimes. Allocate 138 test lines for the scheduling and retention regressions; support fixtures are separate.

The shutdown-check cache opt-in is excluded because its measured memory and cold-start tradeoffs failed acceptance.
@vincentkoc vincentkoc self-assigned this Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 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 scripts Repository scripts size: M labels Nov 15, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 15, 2026 10:09
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR keeps cache-enabled CI worker builds sequential and releases prepared input snapshots while cache handles remain usable.

Example: A full worker compilation runs with CI=1, OPENCLAW_VITEST_WORKER_CACHE=1, and 16 GiB available memory.

  • Before: The shared and preserved-module build graphs overlap.
  • After: The graphs run sequentially; large local hosts retain parallel compilation.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair is correct by source review and supported by boundary regressions and green exact-head gates; the evidence does not establish a measured real-build performance improvement.
Proof confidence 🦐 gold shrimp (3/6) This internal tooling change has focused compiler-boundary and real cache-lifetime regressions; it introduces no user-visible product behavior requiring separate live proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Cache-enabled CI can overlap large compiler graphs, and completed metadata preparation leaves unnecessary snapshot memory reachable through live cache handles.
Reason: The maintainer-authored direction restores the documented CI resource contract and removes unnecessary retention with minimal production changes.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes focused, justified repairs, with no actionable patch defect found and exact-head CI passing.

Priority: P2
Reviewed head: db5895bf0079682eb09206ddfecac0df0f70f4b6

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Vitest worker compiler turns source entries into reusable subprocess artifacts, while its cache owner verifies retained outputs and prepares input signatures.

flowchart TD
  A[Vitest invocation] --> B[Worker compiler]
  B --> C[Cache owner]
  C --> D[Input signature]
  C --> E[Verified retained artifacts]
  B --> F[Build graph scheduling]
  F --> G[Compiled worker artifacts]
Loading

Technical review

Best possible solution:

Keep the existing compiler and cache owners, restrict build overlap to local execution, and scope snapshots to the memoized metadata initializer.

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

Current-main source exposes both paths directly; the PR reports baseline failures and passing focused regressions, which were inspected but not executed during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it reuses the existing CI policy and narrows snapshot lifetime without changing cache signatures, artifact validation, or local parallel-build support.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against de40bf5ca2c0.

Provenance checked

  • Compiler graph scheduling keeps the original intent (fix(test): reuse compiled runtime workers across local runs #153558: Allow independent compilation to overlap on large local hosts while retaining sequential preparation in CI.)
  • Cache metadata preparation keeps the original intent (f878cec: Reuse verified cached workers using a native-free environment signature; the patch preserves that signature and its memoization.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests +265, Other +10. Total +275 across 7 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 265 0 +265
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 16 6 +10
Total 7 281 6 +275

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs internal compiler resource scheduling and unnecessary memory retention without an established urgent user-facing outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 15, 2026, 5:23 AM ET / 10:23 UTC.

@vincentkoc
vincentkoc merged commit 6348733 into main Nov 16, 2026
220 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-shutdown-worker-cache-20261112 branch November 16, 2026 09:44
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit to steipete/openclaw that referenced this pull request Nov 16, 2026
Declare the two live spawned test fixtures introduced by openclaw#199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after openclaw#200038 retired its access call. Preserve all readiness assertions and production behavior.
steipete added a commit that referenced this pull request Nov 16, 2026
* fix(ci): restore worker fixture and readiness checks

Declare the two live spawned test fixtures introduced by #199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after #200038 retired its access call. Preserve all readiness assertions and production behavior.

* fix(test): hold current runtime preparation during startup readiness

* fix(ci): complete live workflow consumer graph after consolidation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
Keep cache-enabled CI builds sequential while preserving parallel builds on large local hosts. Release completed input snapshots after memoized cache metadata is prepared.

Cover actual compiler scheduling and cache miss/hit retention with owned child lifetimes. Allocate 138 test lines for the scheduling and retention regressions; support fixtures are separate.

The shutdown-check cache opt-in is excluded because its measured memory and cold-start tradeoffs failed acceptance.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…w#200133)

* fix(ci): restore worker fixture and readiness checks

Declare the two live spawned test fixtures introduced by openclaw#199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after openclaw#200038 retired its access call. Preserve all readiness assertions and production behavior.

* fix(test): hold current runtime preparation during startup readiness

* fix(ci): complete live workflow consumer graph after consolidation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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