Repository navigation
Update managed Pi installs with pi update instead of npm - #6869
Merged
ymichael merged 2 commits intoNov 2, 2026
Merged
Conversation
Pi's installers (pi.dev/install.sh and install.ps1) create a managed install: a launcher in ~/.pi/agent/bin, optionally symlinked from another PATH directory, and releases under ~/.pi/agent/install with a managed-install.json marker. bb reported it as an external install and offered npm install -g, which leaves a second npm-installed Pi beside the managed one instead of updating it. Detect the managed install from its marker, following the PATH symlink (resolvePiManagedInstallRoot), and offer `pi update --self` for managed installs, ahead of the npm and Bun checks. Installs bb cannot classify also get `pi update --self`: Pi detects its own npm, pnpm, yarn, Bun or configured update command and fails with its own instructions when it cannot. Fresh installs still go through npm. The install gate's too-old message points managed installs at pi update too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… test Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/fix-bb-detection-of-managed-pi-installs-thr_8nnix6m53a
branch
November 2, 2026 22:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Pi's installers (
pi.dev/install.sh,install.ps1) create a managed install: a launcher in~/.pi/agent/bin(on Unix, symlinked from a PATH directory such as~/.local/bin) and releases under~/.pi/agent/install, marked bymanaged-install.json. Pi updates it withpi update. The Pi provider's maintenance bridge only knew Bun and npm global installs. It reported the managed install asexternalbut still offerednpm install -g @earendil-works/pi-coding-agent@latestfor any install that wasn't Bun. Running that adds a second, npm-installed Pi and leaves the managed one on the old version.Reproduced with Pi's real installers pinned to 1.4.0 (served from a local API) on macOS with a sandbox
HOME, and on the Windows 11 ARM64 VM with a sandboxPI_CODING_AGENT_DIR. Both calledgetPiProviderInstallationStatus/getPiProviderInstallationRunon main:What changed
plugins/provider-pi/src/bridge/pi-managed-install.ts(new):resolvePiManagedInstallRootresolves thepion PATH withrealpathand reads<agent>/install/managed-install.json(BOM tolerated, validated with zod:kind,schemaVersion: 1,layout: "releases-v1"). Carry the Pi bridge channel over a socket so every launcher works #6857 removed the earlier Windows-only marker check, so this is now the only one.provider-maintenance.ts: chooses the install or update command in this order:pi update --self. This is checked before npm, so a managed launcher placed in npm's bin directory isn't treated as an npm install.bun add -g, as before.pi update --selfinstead of npm. Pi detects its own npm, pnpm, yarn or Bun install, or a configured update command, and fails with its own instructions when it can't.installSourceis unchanged. Managed installs reportexternal, as Claude's native installs do, so there's no wire or SDK change and no protocol bump.Related to #3166: this stops bb from creating a duplicate npm Pi. It doesn't add the general detection #3166 asks for, which would recognise installs owned by another package manager across all providers.
How you verified
provider-maintenance.install-source.test.ts:pnpm exec turbo run test typecheck lint --filter=bb-plugin-provider-pi: 39 files, 348 passed, 5 skipped.pi update --self. Before the rebase, running that command updated the managed install to 1.5.0 and left the npm Pi at 1.4.0. Status afterwards showedcurrentVersion 1.5.0,installAction null.pi update --selffor...\agent\bin\pi.cmd.cmd.exe /d /s /c "pi update --self"updated it from 1.4.0 to 1.5.0, the npm Pi stayed at 1.4.0, and status afterwards was clean. The user PATH was unchanged and the sandbox was removed.🤖 Generated with Claude Code