Skip to content

[EPIC-U][LOU-HEALTH] No node:crypto import in toolRunContext; keep the Worker bundle loadable - #107

Merged
LinuxDevil merged 1 commit into
mainfrom
fix/worker-crypto-import
Oct 1, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fix/worker-crypto-import

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What

Replace the node:crypto randomUUID import in src/execution/toolRunContext.ts with the Worker-safe newId() helper (globalThis.crypto.randomUUID). Generated ids keep the call_ prefix.

Why

LOU-U15 (#99) introduced the import. workerd cannot load node:crypto (No such module "crypto"), so the cloudflare adapter test wrangler dev serves the worker on the local workerd runtime fails on main and blocks test:coverage. Five open PRs reported the same failure.

Acceptance criteria

  • src/execution/toolRunContext.ts imports nothing from node:*
  • src/deploy/adapters/cloudflare.test.ts passes (15 tests)
  • src/execution/toolRunContext.test.ts passes (8 tests)

How verified

npx tsc --noEmit            # ok
npm run build               # ok
npx vitest run src/execution/toolRunContext.test.ts src/deploy/adapters/cloudflare.test.ts
# Test Files 2 passed (2), Tests 23 passed (23)

🤖 Generated with Claude Code

https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR


Generated by Claude Code

…ker bundle loadable

LOU-U15 (#99) imported randomUUID from node:crypto in src/execution/toolRunContext.ts,
which workerd cannot load ('No such module "crypto"'), so the cloudflare
'wrangler dev serves the worker' test failed on main. Use the Worker-safe newId()
helper (globalThis.crypto.randomUUID) instead; the generated id keeps the call_ prefix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
@LinuxDevil
LinuxDevil merged commit 003ae8a into main Oct 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants