Skip to content

fix(test): avoid plugin retention child startup timeouts - #150951

Merged
steipete merged 1 commit into
mainfrom
upd/flake-plugin-retention-child
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/flake-plugin-retention-child

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150898, #150244

What Problem This Solves

Fixes plugin-retention tests being killed at their 20-second child deadline when a loaded CI shard spends that budget compiling TypeScript imports.

User Impact

No user-visible runtime change. CI exercises the existing plugin-retirement assertions without charging source compilation to the child execution deadline. The GC checks and 20-second deadline remain unchanged.

Why This Change Was Made

Pass pluginRuntimeRetentionEntrypoint through the shared createRuntimeProcessBuildEntries descriptor list and register its declaration for prepared-worker substitution. Its sourceWorkerName is runtime.retention.test-support, and its distWorkerPath is plugins/runtime.retention.test-support.js; currentModuleUrl is import.meta.url in the descriptor module.

The compiler’s import-closure collector tracks the descriptor, and the build hooks track the child source. The existing worker-artifact probe checks prepared JavaScript selection; the freshness fixture now verifies both input records and rejects a changed retention descriptor. This uses the inventory and lazy-input ownership introduced by #150244. Production runtime code is unchanged: tooling +4/-0, tests/support +33/-18 lines.

Evidence

  • Rebased onto 1ebfbb58216c88fe2416ce3d768e1289559ece99; verified that merged fix: Windows cleanup leaves descendants running after leader exit #150244 (146c4147a8691f3f8dfa150300d5e996fa521efa) is an ancestor. Frozen-lockfile install passed.
  • Fresh Codex autoreview of committed head e8ddf61ed8e1c227e3c7c7faa93e81bd07a4daa9 against origin/main, maximum priority P1: scoped-clean, no actionable findings.
  • Original failure: CI run 35228815551, checks-node-compact-large-10, head 16a410f25e0e25ca870bb689f48d044a80acaa4f: loader child killed by SIGTERM at 20.164 s, with 9,807 other passes.
  • Mechanism proof recorded before this rebase: Linux Node 24.19.0 source child completed in 10.742 s without added load and was killed at 20.081 s with eight CPU burners; the prepared macOS loader case completed in 1.734 s. The retained child implementation and GC semantics are unchanged. The child is silent, so first-output timing is unavailable.
  • The original new-declaration regression failed before registration. Earlier prepared-worker retention runs passed 9/9, including the permitted single-worker run with a 3.596 s loader case.
  • Current-head single-worker retention proof passed 9/9; loader case 10.419 s, within the unchanged 20-second deadline. The worker-artifact attempt passed three cases and hit the existing fs-safe package probe’s 120-second deadline under host load. It was not rerun.
  • Direct node scripts/check-changed.mjs passed formatting, ratchet, boundary, dependency, and erasability guards, then stopped before TypeScript compilation because a retained local dist-artifact ownership lock was stale. No check retry or deadline, dependency, or baseline change was made.
  • Current-head pull_request CI run 35237032106 is green. The native watcher returned GREEN with GitHub rollup SUCCESS, zero pending checks, and exit code 0 for head e8ddf61ed8e1c227e3c7c7faa93e81bd07a4daa9. No CI rerun was requested.
  • Inspected the prepared generation on this head: both the retention descriptor and child source are recorded inputs with matching SHA-256 hashes, and the compiled JavaScript entry exists.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 17, 2026 14:35
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 11:31 AM ET / 15:31 UTC (Revision 4).

ClawSweeper review

What this changes

Precompiles the plugin memory-retention test child through the shared test-worker system and extends artifact selection and freshness coverage.

Merge readiness

✅ Ready for maintainer review

The fix remains useful: current main still charges TypeScript startup to the retention child's deadline. No actionable correctness or security findings remain, and the cited CI run passed for the reviewed head.

Priority: P2
Reviewed head: e8ddf61ed8e1c227e3c7c7faa93e81bd07a4daa9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with preserved assertions, relevant execution evidence, successful current-head CI, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this member-authored internal tooling PR; its supplied evidence exercises the changed retention-child entrypoint and reports 9/9 current-head passes, supported by verified successful CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this member-authored internal tooling PR; its supplied evidence exercises the changed retention-child entrypoint and reports 9/9 current-head passes, supported by verified successful CI.
Evidence reviewed 8 items Current main still uses source startup: The fetched main revision launches runtime.retention.test-support.ts with --import tsx inside the 20-second execFile timeout; the proposed prepared-worker invocation is still absent.
Existing assertions and deadline preserved: The reviewed test retains all eight child scenarios, --expose-gc, the 20-second child deadline, and the separate asynchronous retirement test. The child implementation and its GC assertions are unchanged.
Shared compilation and freshness ownership: The compiler collects its import closure, records loaded source inputs, and builds worker descriptors alongside executable entries. The new registration therefore uses the existing preparation and verification owner.
Findings None None.
Security None None.

How this fits together

OpenClaw's test runner prepares executable workers before tests launch subprocesses. The plugin retention tests use those subprocesses to verify that retired plugin objects can be garbage-collected.

flowchart TD
  A[Test runner] --> B[Worker descriptor]
  B --> C[Shared worker compiler]
  C --> D[Hashed JavaScript artifacts]
  D --> E[Retention child process]
  E --> F[Plugin retirement and GC assertions]
  F --> G[Test result within unchanged deadline]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +15, Other +4. Total +19 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 33 18 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 6 37 18 +19

Review metrics

Metric Value Why it matters
Retention protection 8 child scenarios; 20-second deadline unchanged The fix removes source compilation from the bounded execution path without relaxing the retention checks.

Technical review

Best possible solution:

Keep compilation in the shared worker preparation phase while preserving the existing retention assertions and execution deadline.

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

Yes for the mechanism: main launches the source child inside its timeout, and the supplied evidence records failure under CPU load. This read-only review did not independently reproduce the timing failure.

Is this the best way to solve the issue?

Yes. Registering the existing child with the shared compiler is a narrow repair that preserves source-mode behavior, freshness verification, and GC semantics.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This addresses a concrete internal test reliability defect with no user-facing runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this member-authored internal tooling PR; its supplied evidence exercises the changed retention-child entrypoint and reports 9/9 current-head passes, supported by verified successful CI.

Evidence

What I checked:

  • Current main still uses source startup: The fetched main revision launches runtime.retention.test-support.ts with --import tsx inside the 20-second execFile timeout; the proposed prepared-worker invocation is still absent. (src/plugins/runtime.retention.test.ts:30, b669279a2e01)
  • Existing assertions and deadline preserved: The reviewed test retains all eight child scenarios, --expose-gc, the 20-second child deadline, and the separate asynchronous retirement test. The child implementation and its GC assertions are unchanged. (src/plugins/runtime.retention.test.ts:14, e8ddf61ed8e1)
  • Shared compilation and freshness ownership: The compiler collects its import closure, records loaded source inputs, and builds worker descriptors alongside executable entries. The new registration therefore uses the existing preparation and verification owner. (scripts/lib/vitest-worker-compiler.mts:54, e8ddf61ed8e1)
  • Regression coverage uses existing boundary fixtures: The shared probe checks prepared versus source selection, while the freshness fixture requires both retention inputs and rejects a changed descriptor. These extend existing fixtures without weakening assertions or increasing deadlines. (test/scripts/vitest-worker-artifacts.test.ts:1292, e8ddf61ed8e1)
  • Correct substitution boundary: The actual plugin file is test/vitest/vitest.worker-artifacts.ts; it was subsequently read fully. It substitutes registered descriptors before collection, preserves source descriptors for build-map imports, and leaves standalone/watch execution on source. (test/vitest/vitest.worker-artifacts.ts:85, e8ddf61ed8e1)
  • Captured execution evidence and verified CI: The supplied PR body reports a source-child timeout under CPU load and current-head retention results of 9/9, including a 10.419-second loader case. It discloses the incomplete local artifact/check attempts. A separate GitHub read confirms https://github.com/openclaw/openclaw/actions/runs/35237032106 completed successfully for the exact reviewed head. (e8ddf61ed8e1)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (3 earlier review cycles)
  • reviewed 2026-09-17T14:47:16.362Z sha be58c99bd0eb4ec0911ebf350a5e9f83b8910e79 :: blocked before merge. :: none
  • reviewed 2026-09-17T15:04:48.143Z sha e8ddf61 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T15:17:03.676Z sha e8ddf61 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the upd/flake-plugin-retention-child branch from be58c99 to e8ddf61 Compare September 17, 2026 14:57
@steipete
steipete merged commit 27bd778 into main Sep 17, 2026
189 checks passed
@steipete
steipete deleted the upd/flake-plugin-retention-child branch September 17, 2026 15:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…0951)

Avoid plugin-retention CI timeouts caused by compiling TypeScript imports inside the child process execution deadline. Register the existing child with the shared prepared-worker compiler and declaration inventory, then launch it through the existing runtime-worker resolver.

Extend the existing artifact-selection and freshness fixtures. Production runtime behavior, GC assertions, source fallback, scenario arguments, and the 20-second deadline remain unchanged.

Validation: current-head retention proof passed 9/9; CI run 35237032106 passed for e8ddf61 with zero pending checks. Scoped review found no actionable defects.

Related: openclaw#150898, openclaw#150244.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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