Repository navigation
fix(test): stop the node suite collecting workerd-only tests - #143
Merged
Merged
Conversation
a60d0e1 ("chore(devops): align compatibility date and upgrade agents SDK to 0.19.0") applied the Cloudflare Agents SDK version number to the wrong package. `agents@0.19.0` exists; `hono-agents` has never published a 0.19.x -- it ships on a 3.x line (currently 3.0.12). package-lock.json was never regenerated and still resolves 3.0.7, so npm ci has failed on every PR and every Workers Build since 2026-08-07: npm error notarget No matching version found for hono-agents@^0.19.0. Restores the declaration the lockfile already names, keeping the change to a single variable rather than also jumping to 3.0.12. Verified locally: npm ci succeeds (274 packages, hono-agents 3.0.7 installed) and `npm run build` (tsc --noEmit) exits clean. src/index.ts:3 imports agentsMiddleware from hono-agents, so 3.0.7 satisfies real usage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKKxbsxh4tozUMzBKADSTd
`npm audit --audit-level=high --omit=dev` (the CI gate) reported 5 high-severity advisories in dependencies shipped to the Worker runtime. The gate has been UNREACHABLE on main since a60d0e1 (2026-08-07) because npm ci failed before it, so these went unmeasured rather than unintroduced -- three of the four advisories checked predate that commit (2026-06-15, 07-29, 08-06). Every fix stays within the existing major version; no breaking bumps: hono ^4.12.23 -> ^4.13.8 (direct; advisory <=4.13.4) js-yaml override ^4.3.2 (advisory 4.0.0-4.3.1) nanoid override ^5.1.16 (advisory 4.0.0-5.1.15) fast-uri override ^3.1.8 (advisory 3.0.0-3.1.5) ip-address override ^10.7.2 (advisory <=10.3.0) nanoid reached the runtime tree twice, via agents and partyserver. `npm audit fix` could not produce this -- it crashes with an internal arborist error ("Cannot read properties of null (reading 'edgesOut')"). The lockfile was regenerated with npm install instead. Verified locally: npm audit --audit-level=high --omit=dev exit 0 (5 high -> 0; 5 low/2 moderate remain, below gate) npm ci exit 0 tsc -p tsconfig.json --noEmit exit 0 npm test 6 passed / 1 failed -- identical on the parent branch without these bumps; tests/workers/coordinator.test.ts cannot resolve the `cloudflare:test` virtual module under the default vitest pool. Pre-existing, untouched here. Also corrects ci.yml's claim that "the runtime dependency tree is clean". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKKxbsxh4tozUMzBKADSTd
The Dependency Audit comment asserted all High/Moderate advisories were dev-only. That went stale: the gate was unreachable from 2026-08-07 to 2026-09-18 because npm ci failed ahead of it, and when it next ran it found 5 high-severity advisories in the production tree -- three of which predated the break. A comment cannot track advisory feeds; the gate is the source of truth. Replaced with a note saying so, to stop the claim being reinstated. Note: the preceding commit's message says it corrects this comment. It did not -- the edit was blocked by a pre-commit hook and is landed here instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKKxbsxh4tozUMzBKADSTd
vitest.config.ts includes `tests/**/*.test.ts`, which collects
tests/workers/coordinator.test.ts. That file imports the `cloudflare:test`
virtual module, which exists only under @cloudflare/vitest-pool-workers --
so the node suite fails to resolve it and CI's `build` job dies:
Error: Cannot find package 'cloudflare:test' imported from
tests/workers/coordinator.test.ts
Serialized Error: { code: 'ERR_MODULE_NOT_FOUND' }
Those tests already have their own config and script
(vitest.workers.config.mts, `npm run test:workers`). Excluding tests/workers
from the node suite puts each file under the pool it was written for.
Before: 6 passed / 1 failed. After: 6 passed / 0 failed (68 tests, 39 skipped).
Note: `npm run test:workers` is NOT wired into any CI workflow, so the Durable
Object suite does not run in CI at all. It also cannot currently pass locally --
workerd rejects compatibility_date 2026-08-07 as newer than the 2026-08-06 its
binary supports. Both are tracked separately; this commit does not hide them,
it stops them masquerading as a node-suite failure.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKKxbsxh4tozUMzBKADSTd
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Warning Review limit reachedNext included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
chittycommand | badf7a1 | Sep 18 2026, 03:13 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #142 (which is stacked on #141), so it carries those commits. Merge in order, or merge this one and close the others as contained.
The failure
CI's
buildjob dies at the Test step:vitest.config.tscollectstests/**/*.test.ts, which sweeps intests/workers/coordinator.test.ts. That file imports thecloudflare:testvirtual module, which exists only under@cloudflare/vitest-pool-workers. The node suite cannot resolve it.Those tests already have their own config and script —
vitest.workers.config.mtsandnpm run test:workers. This excludestests/workers/**from the node suite so each file runs under the pool it was written for.Two things this deliberately does NOT hide
npm run test:workersis not wired into any CI workflow. The Durable Object suite does not run in CI at all. Excluding these files from the node suite does not change that — it was already true, and the import error was not a substitute for running them.a60d0e1setcompatibility_dateto 2026-08-07, one day beyond the installed workerd. Tracked separately — see the PR discussion; it needs a wrangler ≥ ~4.120, which in turn requires@cloudflare/workers-typesv5 whiledrizzle-orm/partyserverare on v4.Both are recorded in the commit message so they are not lost.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKKxbsxh4tozUMzBKADSTd