fix(cli): support separate host IDs on shared Linux machines

EA
5h ago
+325-34

What & why

Fixes #8443.

Two Linux users on the same machine derive the same host ID from /etc/machine-id. Once one user registers it, the second user's registration is rejected by the host ownership check.

An additional Linux user can run paradev start --daemon --user-scoped-id once to include their Linux UID in the host ID. The choice is stored in their home directory and reused across restarts. The first user keeps their existing host ID and workspace associations. SSH host setup and removal use the same effective ID as the remote account.

How I tested it

Built the Linux ARM64 CLI and ran it as two OS users in one isolated Linux container, with the real registration logic and host tunnel client against a local API and WebSocket relay fixture. I verified that the flag asks the user to stop an already running host before changing its ID, and that the SSH probe returns the same ID as each host process.

Before and after from the smoke test (IDs abbreviated):

AccountDefault startAfter Bob opts inAfter Bob restarts with plain start --daemon
Alice (UID 1001)2e14452c, online2e14452c, online2e14452c, online
Bob (UID 1002)2e14452c, registration rejected with FORBIDDEN2f7f383d, online2f7f383d, online
  • bun run lint and bun run typecheck passed.
  • All 536 CLI tests passed. The focused shared host ID and server ownership tests also passed.
  • The full monorepo test run stopped on an existing macOS date-format assertion in packages/shared/src/rrule.test.ts. The formatter returned “at” where the test expects a comma.

Checklist

  • PR title follows conventional commit format
  • bun run lint and bun run typecheck pass
  • Allow edits from maintainers
  • Contributor License Agreement

Summary by cubic

Fixes #8443. Linux users sharing one machine no longer collide on the same host ID derived from /etc/machine-id, which previously caused the second user's registration to be rejected.

  • Run paradev start --daemon --user-scoped-id once to get a per-user host ID; the choice is stored in the home directory and reused on later starts.
  • The original user's host ID and workspace associations are unchanged.
  • SSH host setup and removal use the same effective host ID as the remote account, and hosts remove locates the key by reading the remote config so it revokes the correct key after a user switches ID.
  • The option is Linux-only and requires stopping any running host before switching. A live process that cannot be identified or signaled counts as a possible running host rather than being ignored.

Summary by CodeRabbit

  • New Features
    • Added the paradev start --user-scoped-id option to assign a persistent, Linux-user-specific host ID on shared machines. The option checks for potentially live hosts before enabling and is unavailable on non-Linux systems.
  • Bug Fixes
    • Improved host setup and removal on shared machines, including identifying the correct host and revoking its associated access key.
  • Documentation
    • Updated the CLI reference and Remote Access guide with instructions for using distinct host IDs on shared Linux machines, including stopping an already-running host before enabling the option.