.agents/memory/2026-03-03-signet-daemon-1password-sdk-wasm-crash-fix.md

1.3 KiB

2026-03-03 Session Notes

Signet Daemon @1password/sdk WASM Crash Fix

Nicholai initiated work on fixing a critical daemon startup crash caused by the @1password/sdk package. The issue stems from the SDK bundling a native WASM binary (core_bg.wasm) whose absolute path from the CI runner (/home/runner/work/signetai/...) gets baked into dist/daemon.js at build time. When users install the daemon, this hardcoded path no longer exists, triggering ENOENT crashes on every startup.

The solution involves lazy-loading the 1Password module so the WASM binary is only loaded when 1Password features are actually used, rather than on daemon startup. This avoids the crash for users without 1Password integration.

Three files require modification:

  1. packages/daemon/src/onepassword.ts: Remove top-level SDK import and move it to dynamic import inside defaultOnePasswordClientFactory
  2. packages/daemon/src/daemon.ts: Keep existing imports unchanged (they reference local code, not the SDK)
  3. packages/daemon/package.json: Add --external @1password/sdk flag to bun build commands to prevent WASM bundling

The session began with reading the source files to implement these changes. Verification will involve daemon startup, health check, testing 1Password features with OP_SERVICE_ACCOUNT_TOKEN, and running full test suite.