Skip to content

fix(cli): recognize standalone and Homebrew launchers in doctor and reinstall - #381

Merged
kombuchapunk merged 2 commits into
mainfrom
fix/reinstall-standalone-homebrew
Dec 4, 2026
Merged

kombuchapunk merged 2 commits into
mainfrom
fix/reinstall-standalone-homebrew

Conversation

@kombuchapunk

Copy link
Copy Markdown
Collaborator

Summary

Fixes sessionpipe doctor and sessionpipe reinstall when the active sessionpipe command was installed via our official standalone installer (website/public/install.sh) or Homebrew (scripts/homebrew-formula.mjs), especially when an older orphaned npm install (e.g. 0.18.6 in ~/.local/lib/node_modules/sessionpipe) remains on disk.

Root Cause

look() in packages/cli/src/reinstall/find.ts only resolved npm symlinks (binTarget) and direct symlinks to .../dist/cli.js. Official standalone launchers (~/.local/bin/sessionpipe) and Homebrew wrappers (/opt/homebrew/bin/sessionpipe -> ../Cellar/.../bin/sessionpipe) fell into strangers, cleared typed, triggered inWay, and caused reinstall to refuse with mv -n ~/.local/bin/sessionpipe ... && npx -y sessionpipe@latest reinstall.

Changes

  • packages/cli/src/reinstall/find.ts: adds bounded, read-only readLauncher() (max 4 KiB plain file, never executed, rejects CRLF/FIFOs/shell metacharacters/node_modules/out-of-reach targets) recognizing standalone (install.sh) and Homebrew launchers on PATH (including Homebrew Cellar symlinks), plus broken standalone installs where app/, .standalone, or package.json is missing.
  • packages/cli/src/reinstall/plan.ts, run.ts, page.ts: keeps healthy standalone and Homebrew installs untouched (stays) while removing provably-ours leftover npm copies (without weakening ours.ts deletion proofs and without requiring npm/network), prints an upgrade note if a newer release is out, and directs broken/outdated managed installs to curl -fsSL https://sessionpipe.org/install.sh | sh or brew upgrade/brew reinstall (never mv -n).
  • packages/cli/src/cli.ts: aligns sessionpipe doctor output and next-step hints with reinstall across standalone, Homebrew, leftover-npm, and broken-install states.
  • .changeset/reinstall-standalone-homebrew.md: patch changeset for sessionpipe.

Verification

  • Built by Gemini 4 Neon and adversarially verified against built dist by Opus 5.5 (PASS across live standalone+0.18.6 npm cleanup, Homebrew Cellar symlink, outdated+leftover agreement, broken standalone recovery, and 16 launcher security/FIFO/ReDoS probes).
  • npm run lint, npm run typecheck, npm run build, npm run schemas -- --check, npm run conformance, and full monorepo npm run test:coverage (4,948 tests, 100% Stmts / Branch / Funcs / Lines).

…einstall

Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…d standalone app, add changeset

Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
@kombuchapunk
kombuchapunk merged commit ab3aaca into main Dec 4, 2026
18 checks passed
@kombuchapunk
kombuchapunk deleted the fix/reinstall-standalone-homebrew branch December 4, 2026 17:16
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.

1 participant