Skip to content

fix(test): prevent Vitest preloads from breaking packaged workers - #160069

Merged
joshavant merged 1 commit into
mainfrom
fix/plugin-worker-test-environment
Sep 28, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/plugin-worker-test-environment

Conversation

@joshavant

@joshavant joshavant commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The packaged-plugin worker test fails with MODULE_NOT_FOUND: vitest/runtime when its temporary worker inherits Vitest’s preload arguments.

User Impact

This repairs a CI fixture. Application behavior is unchanged.

Why This Change Was Made

The fixture now uses the existing runtime worker-argument helper to launch its built JavaScript worker. The worker’s reply assertion and shutdown remain intact.

Evidence

  • Reproduced the original CI shard in its recorded group order on Node 24.19: 359 cases passed and the packaged worker failed with the same missing-module error. The local platform was macOS arm64; the original CI failure was Linux x64.
  • After repair, the focused file passed all 27 cases (7.74s Vitest; 57.17s command including the required runtime rebuild). The previously failing worker completed in 36ms.
  • The original failing group passed all 60 cases after repair (59.98s Vitest; 113.16s command including private-QA preparation). The separate unchanged first group had already passed all 300 cases.
  • Fresh independent review found no actionable P0–P2 issues. Root-test types (20.64s), targeted lint (19.99s), formatting, and diff checks passed.
  • CI on the published head passed. The hosted focused file passed all 27 cases (5.090s file time; 6.52s Vitest), including the packaged worker in 33ms. All 38 reported checks/statuses succeeded, 90 were skipped, and none remained pending or failed. The current ClawSweeper review reported no actionable findings.

@clawsweeper

clawsweeper Bot commented Sep 28, 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.

@joshavant
joshavant marked this pull request as ready for review September 28, 2026 03:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 11:41 PM ET / September 28, 2026, 03:41 UTC.

ClawSweeper review

What this changes

The plugin package-build test now supplies runtime-selected launch arguments when it starts a built JavaScript worker.

Merge readiness

✅ Ready for maintainer review

Current main still has the reported fixture failure path. This collaborator-authored PR offers a focused repair using the existing worker-launch helper, with no blocking patch defect identified.

Priority: P2
Reviewed head: c5012151ebf2a3d25c5310c4e8d82472de547e9e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, source-consistent fixture repair has relevant reported before-and-after execution evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.
Evidence reviewed 6 items Introduced change: The pinned PR delta changes only the packaged-worker fixture’s launch arguments; the reply assertion and shutdown remain.
Current-main gap: Fetched main still starts the built worker without explicit execArgv, leaving it able to inherit Vitest preloads.
Existing launch owner: The shared helper returns no preload arguments for a built JavaScript worker and selects the TypeScript loader for source workers.
Findings None None.
Security None None.

How this fits together

The plugin package-build test creates a temporary plugin package, builds it, then starts its worker to check the packaged output. Vitest starts the test, and the worker’s reply determines whether the fixture passes.

flowchart LR
A[Vitest runner] --> B[Plugin package fixture]
B --> C[Built plugin entry]
C --> D[Worker URL]
D --> E[Runtime launch arguments]
E --> F[Worker reply assertion]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +3. Total +3 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 1 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 1 +3

Review metrics

Metric Value Why it matters
Focused test cost 27 cases; 7.74s Vitest, 57.17s including rebuild The PR body measures the changed fixture’s test time and its larger build setup cost.

Technical review

Best possible solution:

Keep the packaged-worker fixture on the shared launch-argument resolver so built JavaScript workers avoid test-runner preloads while source workers retain their required loader.

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

Yes. Current main leaves the worker launch arguments implicit, and the PR body records the missing-module failure in the original shard; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The patch uses the existing runtime-owned helper at the failing worker launch, matching the documented direct-worker fixture pattern.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8e57f5447edd.

Labels

Label changes:

  • add P2: A broken package-build fixture disrupts validation, with no reported application-behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.

Label justifications:

  • P2: A broken package-build fixture disrupts validation, with no reported application-behavior 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. Sufficient (terminal): The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed fixture launches a built plugin worker. The PR body reports the original missing-module failure and an after-fix run where the worker replied and both the focused file and original failing group passed; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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