Skip to content

fix: sync pkg/package.json version with pi-coding-agent to prevent false update banner#15

Merged
glittercowboy merged 1 commit intogsd-build:mainfrom
alphinus:fix/pkg-version-sync
Mar 11, 2026
Merged

fix: sync pkg/package.json version with pi-coding-agent to prevent false update banner#15
glittercowboy merged 1 commit intogsd-build:mainfrom
alphinus:fix/pkg-version-sync

Conversation

@alphinus
Copy link
Contributor

Problem

gsd-pi sets PI_PACKAGE_DIR=pkg/ so that pi's config.js reads piConfig from pkg/package.json (for branding). However, config.js also reads version from that same file and uses it for the update check — comparing it against the npm registry.

pkg/package.json had a hardcoded "version": "0.1.0" that was never updated when new versions were published. This means:

  • VERSION in pi's internals is always 0.1.0
  • The update check compares 0.1.0 against the latest npm version (e.g. 0.57.1)
  • Result: "Update Available" banner always appears, even when the user is already on the latest release

Update Available banner showing despite being on latest version

Note: PI_SKIP_VERSION_CHECK=1 was added in a recent commit and suppresses this in newer releases, but the root cause (stale version) remains and could cause issues anywhere VERSION is used.

Fix

  1. Updated pkg/package.json version to match the current pi-coding-agent dependency (0.57.1)
  2. Added scripts/sync-pkg-version.cjs — reads the installed @mariozechner/pi-coding-agent version and writes it into pkg/package.json
  3. Integrated into prepublishOnly so the version is automatically synced on every npm publish

Testing

# Script correctly detects and updates stale version
$ node scripts/sync-pkg-version.cjs
[sync-pkg-version] Updating pkg/package.json version: 0.1.0 → 0.57.1

# Script is idempotent when version already matches
$ node scripts/sync-pkg-version.cjs
[sync-pkg-version] pkg/package.json version already matches: 0.57.1

Affected versions

All published versions of gsd-pi (0.1.x through 0.2.8) show the false update banner when PI_SKIP_VERSION_CHECK is not set.

…lse update banner

pkg/package.json had a hardcoded version (0.1.0) that never got updated.
Since gsd-pi sets PI_PACKAGE_DIR=pkg/, pi's config.js reads VERSION from
pkg/package.json. The update check compares this stale version against npm
registry and always shows 'Update Available' even when the user is already
on the latest release.

Fix:
- Update pkg/package.json to current pi-coding-agent version (0.57.1)
- Add sync-pkg-version.cjs script that reads the installed pi-coding-agent
  version and writes it into pkg/package.json
- Run the sync script in prepublishOnly so the version stays correct on
  every publish
@glittercowboy glittercowboy merged commit 7355d44 into gsd-build:main Mar 11, 2026
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.

2 participants