Skip to content

CLI crashes on every invocation: duplicate 'doctor' command registration (v5.44+ through v5.81.x, macOS arm64) #46

Description

@thepono1

Summary

Every hyperspace / aios-cli invocation crashes immediately on macOS arm64 with a duplicate command registration error in the bundled CLI. Reproduced on every release from v5.44 onwards, including the current latest (v5.81.11 / v5.81.32). v5.43.2 is the last version I can run.

Reproduction

curl -sSL https://download.hyper.space/api/install | bash
hyperspace --version

Stack trace

(node:59973) Warning: Code cache data rejected.
/Users/runner/work/p2pnetwork/p2pnetwork/apps/cli/release/sea-bundle.cjs:1763
          throw new Error(
          ^

Error: cannot add command 'doctor' as already have command 'doctor'
    at _Command._registerCommand (/Users/runner/work/p2pnetwork/p2pnetwork/apps/cli/release/sea-bundle.cjs:1763:17)
    at _Command.command (/Users/runner/work/p2pnetwork/p2pnetwork/apps/cli/release/sea-bundle.cjs:1358:14)
    at /Users/runner/work/p2pnetwork/p2pnetwork/apps/cli/release/sea-bundle.cjs:476058:12
    at embedderRunCjs (node:internal/main/embedding:89:10)

Node.js v22.22.2

The doctor command is registered twice in the SEA bundle — commander.js throws on the second registration before any subcommand can run.

Versions tested

Version Result
v5.20.0 (from download.hyper.space/api/install) crash
v5.81.11 (latest tagged) crash
v5.81.32 (delivered by in-process auto-updater) crash
v5.43.2 works

Confirmed the bug is in the shipped bundle, not local state: reproduces with HOME=/tmp/empty-home and an empty ~/.hyperspace/.

Blocking secondary issue

v5.43.2 cannot be used as a node because hyperspace start force-runs an in-process auto-updater that downloads the latest (broken) binary and overwrites itself. There is no --no-update flag. Setting chflags uchg on the binary blocks the overwrite but puts the updater into an infinite 787 MB redownload loop, so the node never finishes starting.

Net effect: the CLI is non-functional on macOS arm64. New users can't join the network.

Environment

  • macOS arm64 (Apple Silicon)
  • Installer: curl -sSL https://download.hyper.space/api/install | bash
  • Node runtime bundled in the SEA: v22.22.2

Suggested fix

Locate the duplicate program.command('doctor', ...) (or equivalent) in apps/cli/release/sea-bundle.cjs around line 476058 and remove one of the registrations. Separately, add a --no-update / HYPERSPACE_NO_UPDATE=1 opt-out on hyperspace start so users can pin a known-good version during incidents like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions