Skip to content

fix(home): record the real product version as firstSeenVersion - #628

Merged
raymondfeng merged 1 commit into
mainfrom
fix/first-seen-version
Oct 10, 2026
Merged

raymondfeng merged 1 commit into
mainfrom
fix/first-seen-version

Conversation

@raymondfeng

Copy link
Copy Markdown
Contributor

~/.agentgem/home-state.json records firstSeenVersion: "0.0.0" on npm and desktop installs. A fresh 0.12.1 desktop install showed this.

Cause: home/state.ts read ../../package.json relative to its own file. In workspace dev that path finds @agentgem/app's 0.7.0. In the npm bin and the desktop core bundle, the module is inlined, so the path points above the package and the code falls back to 0.0.0.

Fix:

  • productVersion() searches upward for the first @ninemind/agentgem or agentgem-core manifest and reads its version.
  • desktop/scripts/bundle-core.mjs now writes version into the agentgem-core manifest, which had none before.

Tests: src/__tests__/homeStateVersion.test.ts covers the npm, desktop and workspace layouts. It failed before this change. The existing home-state tests still pass (24/24). A fresh bundle:core writes agentgem-core 0.12.1.

Nothing reads firstSeenVersion yet. The value is set once, so existing files keep 0.0.0.

🤖 Generated with Claude Code

home-state.json read `../../package.json` relative to the module. That only fit
the loose tsc layout, where it found @agentgem/app's 0.7.0 rather than the
product's. Inlined into the npm bin (dist/client.js) or the desktop core
(resources/core/index.mjs) it pointed above the package, so every npm and
desktop install recorded "0.0.0" (seen on a fresh 0.12.1 desktop install).

productVersion() now walks up to the first @ninemind/agentgem or agentgem-core
manifest, and bundle-core writes the version into agentgem-core's
package.json, which had none.

Tested the npm, desktop and workspace layouts in temp dirs (red before the
change). Workspace reports 0.12.1; a fresh bundle:core writes
agentgem-core 0.12.1. Nothing reads firstSeenVersion yet, so no behavior
changes beyond the recorded value. Existing home.json files keep their 0.0.0:
the field is set once on first read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raymondfeng
raymondfeng merged commit 0f7591a into main Oct 10, 2026
1 check passed
@raymondfeng
raymondfeng deleted the fix/first-seen-version branch October 10, 2026 22:34
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