Skip to content

refactor: share worker preload setup across tests - #203058

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-worker-preload-options
Nov 21, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-worker-preload-options

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Fixes #202995

What Problem This Solves

Eleven worker fault fixtures repeat preload-option setup.

User Impact

No intended behavior change; existing fault coverage is retained.

Why This Change Was Made

Reuse the existing helper while preserving programs, flags, workerData identity/overlays, creation-time controls, and cleanup.

Evidence

  • 108 tests across 12 suites passed, no skips; six typegraphs and scoped lint passed.
  • Normal hooks, formatting, and full source review passed.
  • Initial optional JSON reporter setup refusal retained; approved console-only correction passed.
  • Current-head CI/security checks passed, including build-artifacts; no full-build claim.

@vincentkoc vincentkoc self-assigned this Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Nov 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates eleven worker preload-option builders in the existing shared test helper.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source change is coherent and appears correct, but affected-suite and targeted-check execution remain unverified.
Proof confidence 🦪 silver shellfish (2/6) This test-only refactor requires affected-suite validation, but no shipped-entry-point demonstration is required.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Maintainers must preserve identical worker-option assembly across distinct fault fixtures.
Reason: The maintainer-authored direction removes concrete duplication without expanding product scope or weakening behavioral assertions.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored cleanup is focused and appears behavior-preserving, with no actionable correctness or security findings.

Priority: P3
Reviewed head: 753214408b7434725296fda8bcc8f3fbb67f3fc7

Before merge

  • Complete next step - The author should run the affected suites, including cleanup-service.applied-summary.test.ts, cleanup-service.fix-missing.test.ts, and openclaw-agent-execution.custody.test.ts, plus targeted type, lint, and formatting checks before marking the PR ready.

Findings

None.

Agent review details

How this fits together

Fault fixtures pass worker options, preload source, and optional test controls to a shared builder, then launch workers through their existing constructors and lifecycle owners.

flowchart LR
  A[Fault fixtures] --> B[Shared preload helper]
  B --> C[Worker options]
  C --> D[Existing worker constructors]
  D --> E[Fault assertions and cleanup]
Loading

Technical review

Best possible solution:

Use the existing test helper for pure option assembly while leaving fault programs, worker selection, and lifecycle ownership with each fixture.

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

Source inspection establishes duplicated fixture setup; this refactor reports no product defect to reproduce.

Is this the best way to solve the issue?

The shared builder is the smallest complete consolidation: it reuses the existing helper module, removes repeated assembly, and introduces no competing lifecycle owner or redundant tests.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Worker fault-option assembly across the eleven fixtures keeps the original intent (multiple commits documented in the supplied Provenance Evidence: These builders install fixture-specific faults and observations on real workers while preserving production admission and cleanup paths; the refactor retains those programs and boundaries.)
  • Worker source-lookup custody fixture keeps the original intent (2c4413a: The fixture holds a real worker path lookup to verify refusal after source replacement or retirement without blocking the host; its gate, messages, and release lifetime remain unchanged.)
  • Existing child-process runtime preload helper keeps the original intent (ed8741c: Node and Bun descendants require their respective preload environment options; the new worker builder leaves that existing behavior unchanged.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff replaces repeated option assembly without changing preload programs, assertions, worker selection, or cleanup code. (753214408b74)
  • Helper preserves existing contracts: Existing execArgv entries precede the appended import; omitted overlays retain workerData identity, while supplied overlays preserve shallow merge precedence and shared-buffer references. (test/helpers/runtime-preload.ts:14, 753214408b74)
  • Current main still has separate assembly: Fetched main exports only the child-process environment helper; its different responsibility remains intact. (test/helpers/runtime-preload.ts:4, 23f11754c38e)
  • Linked cleanup scope: test: consolidate repeated worker preload options #202995 explicitly requests this pure helper, excludes child-process sites, and explains why sqliteWorkerPreloadEnv cannot replace the fixtures without changing their lifecycle.
  • Validation remains pending: The body lists owning tests and targeted checks as pending; exact-head checks show five ancillary successes and 88 skipped jobs, providing no affected-suite execution evidence. (753214408b74)
  • Feature history: The existing preload helper was added for Node and Bun fixture portability; subsequent worker-fixture repairs preserve runtime-specific execution and teardown contracts. (test/helpers/runtime-preload.ts:4, ed8741c7e237)

Likely related people:

  • Peter Steinberger: Raw commit ed8741c adds test/helpers/runtime-preload.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ed8741c7e237; files: test/helpers/runtime-preload.ts)

PR surface

Tests -41. Total -41 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 12 73 114 -41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 73 114 -41

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:

  • add P3: This is bounded test-maintenance cleanup with no intended product behavior change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is bounded test-maintenance cleanup with no intended product behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 21, 2026, 6:16 AM ET / 11:16 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 21, 2026 11:42
@vincentkoc
vincentkoc merged commit 6978b40 into main Nov 21, 2026
232 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-worker-preload-options branch November 21, 2026 12:12
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 21, 2026
…3044

* origin/main:
  refactor(test): remove duplicate token startup wait case (#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (#203074)
  fix(test): exercise the sign-in callback path guard (#203075)
  refactor(tts): separate caption eligibility from text helpers (#203068)
  test: reuse worker preload options (#203058)
  refactor(test): share Bun native-policy test launcher (#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (#203056)
  refactor(test): remove duplicate claw origin rejection case (#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (#203047)
  refactor: separate skill queries from workspace discovery (#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (#203043)
  fix: avoid repeated filesystem probes before agent turns (#203057)
  perf(agents): preserve sealed history during endpoint compaction (#203037)
  fix(test): give deferred identity fixtures read scope (#203053)
  refactor(test): remove redundant channel catalog facade (#203052)
  refactor(cli): isolate daemon port presentation (#203020)
  refactor(cron): isolate CLI input parsing (#203031)
vincentkoc added a commit that referenced this pull request Nov 21, 2026
* feat: open shared sessions in their source Control UI

* feat: open shared sessions in their source Control UI

OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  fix(ci): decouple boundary fixture from timing inventory (#203026)
  fix(ci): shard capable compatibility UI targets (#203042)
  perf(agents): restore selected subagent payloads once (#203039)
  fix: keep standalone context from completing QA tool steps
  perf(sessions): reuse sealed ownership for context projections (#203040)
  refactor(hooks): separate event predicates from hook registry (#203017)
  fix(ci): align update export audits with their consumers (#203030)
  fix: keep cold baseline checks within the existing heap limit

* fix(session-share): accept the runtime config snapshot in the source link resolver

The stored-session link resolver took a mutable config, so the plugin's readonly
runtime snapshot failed production and test typechecks. Accept the snapshot type.

Document the real Open original setup: allow the link command on the receiver
Gateway, set the source Control UI origin, reinstall the source node with all
three commands, then approve the widened surface. Move the section ahead of
Security boundary and add a troubleshooting entry.

Assert through the Gateway catalog list that a provider-supplied link survives
streamed and final rows, and drop the menu unit test the browser fixture covers.

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  refactor(test): remove duplicate token startup wait case (#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (#203074)
  fix(test): exercise the sign-in callback path guard (#203075)
  refactor(tts): separate caption eligibility from text helpers (#203068)
  test: reuse worker preload options (#203058)
  refactor(test): share Bun native-policy test launcher (#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (#203056)
  refactor(test): remove duplicate claw origin rejection case (#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (#203047)
  refactor: separate skill queries from workspace discovery (#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (#203043)
  fix: avoid repeated filesystem probes before agent turns (#203057)
  perf(agents): preserve sealed history during endpoint compaction (#203037)
  fix(test): give deferred identity fixtures read scope (#203053)
  refactor(test): remove redundant channel catalog facade (#203052)
  refactor(cli): isolate daemon port presentation (#203020)
  refactor(cron): isolate CLI input parsing (#203031)

* chore(plugin-sdk): record the approved session-discussion surface growth

Open original adds two exports to openclaw/plugin-sdk/session-discussion: the
stored-session Control UI path resolver and the session path parser. Raise the
public export and callable budgets by two for them.

Use neutral fixtures for the rejected-origin and rejected-query URL tests so the
fixtures do not resemble credentials; the same rejections are covered.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
* feat: open shared sessions in their source Control UI

* feat: open shared sessions in their source Control UI

OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  fix(ci): decouple boundary fixture from timing inventory (openclaw#203026)
  fix(ci): shard capable compatibility UI targets (openclaw#203042)
  perf(agents): restore selected subagent payloads once (openclaw#203039)
  fix: keep standalone context from completing QA tool steps
  perf(sessions): reuse sealed ownership for context projections (openclaw#203040)
  refactor(hooks): separate event predicates from hook registry (openclaw#203017)
  fix(ci): align update export audits with their consumers (openclaw#203030)
  fix: keep cold baseline checks within the existing heap limit

* fix(session-share): accept the runtime config snapshot in the source link resolver

The stored-session link resolver took a mutable config, so the plugin's readonly
runtime snapshot failed production and test typechecks. Accept the snapshot type.

Document the real Open original setup: allow the link command on the receiver
Gateway, set the source Control UI origin, reinstall the source node with all
three commands, then approve the widened surface. Move the section ahead of
Security boundary and add a troubleshooting entry.

Assert through the Gateway catalog list that a provider-supplied link survives
streamed and final rows, and drop the menu unit test the browser fixture covers.

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  refactor(test): remove duplicate token startup wait case (openclaw#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (openclaw#203074)
  fix(test): exercise the sign-in callback path guard (openclaw#203075)
  refactor(tts): separate caption eligibility from text helpers (openclaw#203068)
  test: reuse worker preload options (openclaw#203058)
  refactor(test): share Bun native-policy test launcher (openclaw#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (openclaw#203056)
  refactor(test): remove duplicate claw origin rejection case (openclaw#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (openclaw#203047)
  refactor: separate skill queries from workspace discovery (openclaw#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (openclaw#203043)
  fix: avoid repeated filesystem probes before agent turns (openclaw#203057)
  perf(agents): preserve sealed history during endpoint compaction (openclaw#203037)
  fix(test): give deferred identity fixtures read scope (openclaw#203053)
  refactor(test): remove redundant channel catalog facade (openclaw#203052)
  refactor(cli): isolate daemon port presentation (openclaw#203020)
  refactor(cron): isolate CLI input parsing (openclaw#203031)

* chore(plugin-sdk): record the approved session-discussion surface growth

Open original adds two exports to openclaw/plugin-sdk/session-discussion: the
stored-session Control UI path resolver and the session path parser. Raise the
public export and callable budgets by two for them.

Use neutral fixtures for the rejected-origin and rejected-query URL tests so the
fixtures do not resemble credentials; the same rejections are covered.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: consolidate repeated worker preload options

1 participant