Skip to content

Fix stale PLUGIN_VERSION drift (permanent update notice + mislabelled telemetry) - #65

Merged
Dhravya merged 2 commits into
mainfrom
d/fix-plugin-version-drift-112b
Aug 2, 2026
Merged

Fix stale PLUGIN_VERSION drift (permanent update notice + mislabelled telemetry)#65
Dhravya merged 2 commits into
mainfrom
d/fix-plugin-version-drift-112b

Conversation

@Dhravya

@Dhravya Dhravya commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #64.

PLUGIN_VERSION in src/config.ts was hand-maintained and had drifted to 2.0.10 while package.json read 2.0.11. Two consequences:

  1. Permanent false-positive update notice. The update check compares the constant against the npm latest dist-tag (2.0.11), so 2.0.11 forever reported that an update to 2.0.11 was available — a notice the user could never clear.
  2. Mislabelled telemetry. src/services/client.ts attaches sm_plugin_version to every write, so 2.0.11 memories were recorded server-side as originating from 2.0.10.

Root-cause fix: derive the version from package.json

Rather than restating the version in source, PLUGIN_VERSION is now generated from package.json's version field, making this class of drift structurally impossible.

  • Added scripts/sync-version.mjs — reads package.json and writes src/version.ts (export const PLUGIN_VERSION = ...).
  • src/config.ts now re-exports PLUGIN_VERSION from ./version.js instead of hardcoding it.
  • Wired generation into build, typecheck, and test scripts, and added a generate:version script.
  • scripts/release.sh regenerates and stages src/version.ts alongside the package.json bump, so the committed source stays in sync automatically.

The generated src/version.ts is committed (currently 2.0.11) so bun test / tsc work without a pre-step; it is only ever written by the generator, never by hand.

Secondary fix (also called out in the issue)

The update notice's remediation command (bunx opencode-supermemory@latest install) is not runnable for users of the standalone opencode binary, which embeds bun privately and exposes no bun/bunx/node/npm on PATH. formatUpdateNotice now adds a runtime-agnostic fallback pointing those users at pinning the version in their opencode config.

Verification

  • npm run typecheck — passes
  • npm run build — passes; confirmed the bundled dist/index.js now carries PLUGIN_VERSION = "2.0.11"
  • npm test — 6/6 pass

Slack Thread

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 2, 2026 18:10
PLUGIN_VERSION was hand-maintained in src/config.ts and had drifted to
2.0.10 while package.json read 2.0.11. This caused a permanent
false-positive update notice (v2.0.10 -> v2.0.11) and mislabelled the
sm_plugin_version telemetry attached to every write.

Generate src/version.ts from package.json's version via
scripts/sync-version.mjs, wired into build/typecheck/test and the release
script so the two can no longer drift.

Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
The remediation command (bunx opencode-supermemory@latest install) is not
runnable for users of the standalone opencode binary, which embeds bun
privately and puts no bun/bunx/node/npm on PATH. Add a runtime-agnostic
fallback pointing them at pinning the version in their opencode config.

Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
@Dhravya
Dhravya marked this pull request as ready for review August 2, 2026 18:57
@Dhravya
Dhravya merged commit a915642 into main Aug 2, 2026
4 checks passed
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.

Hardcoded PLUGIN_VERSION is stale in 2.0.11: permanent false-positive update notice and mislabelled sm_plugin_version on writes

2 participants