Fix stale PLUGIN_VERSION drift (permanent update notice + mislabelled telemetry) - #65
Merged
Merged
Conversation
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
marked this pull request as ready for review
August 2, 2026 18:57
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.
Summary
Fixes #64.
PLUGIN_VERSIONinsrc/config.tswas hand-maintained and had drifted to2.0.10whilepackage.jsonread2.0.11. Two consequences:latestdist-tag (2.0.11), so2.0.11forever reported that an update to2.0.11was available — a notice the user could never clear.src/services/client.tsattachessm_plugin_versionto every write, so2.0.11memories were recorded server-side as originating from2.0.10.Root-cause fix: derive the version from
package.jsonRather than restating the version in source,
PLUGIN_VERSIONis now generated frompackage.json'sversionfield, making this class of drift structurally impossible.scripts/sync-version.mjs— readspackage.jsonand writessrc/version.ts(export const PLUGIN_VERSION = ...).src/config.tsnow re-exportsPLUGIN_VERSIONfrom./version.jsinstead of hardcoding it.build,typecheck, andtestscripts, and added agenerate:versionscript.scripts/release.shregenerates and stagessrc/version.tsalongside thepackage.jsonbump, so the committed source stays in sync automatically.The generated
src/version.tsis committed (currently2.0.11) sobun test/tscwork 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 nobun/bunx/node/npmonPATH.formatUpdateNoticenow adds a runtime-agnostic fallback pointing those users at pinning the version in their opencode config.Verification
npm run typecheck— passesnpm run build— passes; confirmed the bundleddist/index.jsnow carriesPLUGIN_VERSION = "2.0.11"npm test— 6/6 passSlack Thread