Skip to content

pi update fails for a valid global pnpm install #4647

@RVZO6

Description

@RVZO6

What happened?

pi update fails for a valid global pnpm install because the package manager ownership check compares pnpm's root (something like
~/Library/pnpm/global/v11) with the actual resolved path after expanding the symlink (something like ~/Library/pnpm/store/...).

this is because of a node fs.realpathSync() call in isManagedByGlobalPackageManager(), which, well... resolves the real path of the symlinked pi package.

the simplest fix would probably just be avoiding resolving the symlink in the first place.

related files

  • packages/coding-agent/src/config.ts
  • isManagedByGlobalPackageManager()
  • normalizeExistingPathForComparison()
  • getGlobalPackageRoots()

Steps to reproduce

  • pnpm add -g @earendil-works/pi-coding-agent (ideally in an isolated environment)
  • pi update

Expected behavior

pi update correctly identifies pnpm managed installation and runs pnpm add -g @earendil-works/pi-coding-agent@latest (or something like that)

Version

0.75.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginprogressIssue is being worked on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions