Skip to content

Pulse crashes on startup when Bun auto-install is unavailable — PULSE ships no package.json #1345

@Weaverjohn

Description

@Weaverjohn

Environment

  • PAI v5.0.0 (release tag), Linux x64 (WSL2, Ubuntu), Bun 1.3.5
  • Installed via Releases/v5.0.0/.claude/install.sh (CLI mode, completed successfully)

Summary

PAI/PULSE/ ships with no package.json, bun.lock, or node_modules, so
Pulse relies entirely on Bun's runtime auto-install to resolve its external
imports (smol-toml, yaml, grammy, jose, minisearch, …). Bun
silently disables auto-install whenever a node_modules directory exists in
any parent of the working directory — which is common on developer machines
(e.g., a node_modules in $HOME). When that happens, Pulse cannot start
at all:

$ cd ~/.claude/PAI/PULSE && bun run pulse.ts
error: Cannot find package 'smol-toml' from '/home/user/.claude/PAI/PULSE/pulse.ts'
Bun v1.3.5 (Linux x64)

The same root cause breaks the SecurityPipeline hook during install
validation:

✗ SecurityPipeline hook (smoke test): Hook exited 1: error: Cannot find
  package 'yaml' from '.../.claude/hooks/security/inspectors/PatternInspector.ts'

Auto-install also fails on offline/airgapped machines and adds latency +
non-determinism (unpinned versions) on first run even when it does work.

Steps to reproduce

  1. On Linux, have any node_modules directory in $HOME (e.g., mkdir -p ~/node_modules)
  2. Install PAI v5.0.0 via install.sh
  3. cd ~/.claude/PAI/PULSE && bun run pulse.ts

Expected: Pulse starts (it does on a machine where auto-install kicks in).
Actual: immediate crash, Cannot find package 'smol-toml'.

Workaround

cd ~/.claude/PAI/PULSE
bun add smol-toml yaml grammy jose minisearch

After that, Pulse boots cleanly on WSL2 — dashboard on :31337, health
endpoint OK. (The Telegram module additionally wants
@anthropic-ai/claude-agent-sdk.)

Suggested fix

Ship a package.json + bun.lock in PAI/PULSE/ with the runtime
dependencies pinned, and have the installer run bun install there (it
already shells out to bun). Same for the hooks tree (yaml for
PatternInspector). This makes startup deterministic and removes the hidden
dependency on Bun's auto-install heuristics.

Related

Happy to provide the full install/startup logs if useful. Found while
testing v5.0.0 on WSL2 — with the two fixes above, Pulse runs well there
(audio/osascript/iMessage degrade gracefully as expected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions