Use the loaded supermemory config file in install and status - #92
Open
Chebaleomkar wants to merge 2 commits into
Open
Chebaleomkar wants to merge 2 commits into
Chebaleomkar wants to merge 2 commits into
Conversation
The plugin loads supermemory.jsonc before supermemory.json, but the CLI always used supermemory.json. With only a .jsonc (as the README suggests), install treated the setup as fresh and wrote a stray supermemory.json with a copy of the API key and different settings that never took effect, and status reported the key source as not configured. Point CONFIG_FILE at the file that was actually loaded, apply install defaults with jsonc-parser so comments are preserved (and leave unparseable files alone), and parse the file as JSONC in status.
Keeps jsonc-parser out of the plugin runtime bundles, since only install needs it, and warns instead of silently skipping when the existing config cannot be parsed.
This was referenced Sep 27, 2026
ishaanxgupta
added a commit
that referenced
this pull request
Sep 27, 2026
Fixes #97. - Describe what the plugin does today: profile-only first-message context, direct recall by default, the real `[SUPERMEMORY]` and `<supermemory-context>` blocks, `search` scope and `limit` semantics, container tag precedence, `filterPrompt`, capture defaults, and `SUPERMEMORY_DEBUG`. - Document the installer steps once, including the config-directory and in-place config handling from #92 and #94. - The generated /supermemory-login command no longer claims a fixed port, and the tool's help lists `limit` for search. - Add a CI workflow running typecheck, tests, and build on pull requests and pushes to main. - Bump to 2.0.16 so the CLI fixes in #92, #94, and #96 publish together.
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.
Fixes #91
Problem
The plugin loads
supermemory.jsoncbeforesupermemory.json, but the CLI only knew aboutsupermemory.json. With a.jsoncconfig (the file the README tells users to create),statusreported the working key asnot configured, andinstalltreated the setup as fresh and wrote a straysupermemory.jsoncontaining a copy of the API key and settings that never take effect.Fix
src/config.ts: remember which file was actually loaded and export it asCONFIG_FILE. It falls back tosupermemory.jsononly when neither file exists, so fresh installs behave exactly as before.install: apply its defaults to that file withjsonc-parser(via the existingapplyModificationhelper inopencode-config.ts), so user comments, formatting, and settings are preserved instead of the file being rewritten withJSON.stringify. This lives on the CLI side, sojsonc-parserdoes not enter the plugin runtime bundles (v2index.jsstays at ~141.7 KB).status: parse the config as JSONC when reporting the key source.installnow prints⚠ Could not parse <file>; left it unchanged.instead of overwriting the user's file with defaults.No effect on the plugin inside OpenCode sessions:
CONFIG_FILEis only used by the CLI. Users who authenticate vialoginorSUPERMEMORY_API_KEY, or who keep their config insupermemory.json, see no difference. Straysupermemory.jsonfiles created by earlier versions are left alone; #91 tells affected users they can delete them.Before / after
Same repro as #91 (sandboxed
HOME, fake key, onlysupermemory.jsoncpresent):Testing
src/services/opencode-config.test.tsforapplyInstallDefaults: keeps comments and user settings, leaves an existingcaptureEveryNTurnsuntouched, writes fresh-install defaults, returnsnullfor unparseable input.bun run typecheckclean,bun test37 pass.HOMEon Windows 11:installresultstatuskey sourcesupermemory.jsonc.json; file and comments unchanged…/supermemory.jsoncsupermemory.jsonwithrecallMode: "direct",captureEveryNTurns: 0(unchanged from main)not configuredsupermemory.json(legacy)captureEveryNTurns: 3(unchanged from main)…/supermemory.jsonsupermemory.jsoncnot configured