Create the OpenCode config directory before writing install defaults - #94
Merged
Dhravya merged 2 commits intoSep 27, 2026
Merged
Conversation
On a machine where ~/.config/opencode does not exist yet (plugin installed before OpenCode was ever run, fresh CI/Docker/headless boxes), install crashed with ENOENT writing supermemory.json, before any later step that creates the directory could run.
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.
ishaanxgupta
approved these changes
Sep 27, 2026
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 #93
Problem
On a machine without
~/.config/opencode(plugin installed before OpenCode was ever run, fresh CI/Docker/headless boxes),installcrashed withENOENTon its first write tosupermemory.json, before any of the later steps that create the folder could run. The installer did nothing and exited with a stack trace.Fix
One line in
install(): createOPENCODE_CONFIG_DIR(recursive, so a no-op when it exists) beforewriteInstallDefaults(). This matches what the later install steps already do (src/cli.ts:309,:323,:347). It lives ininstall()rather thanconfig.ts, so it doesn't conflict with #92, which moveswriteInstallDefaultsinto the CLI.No behaviour change for users whose folder already exists.
Before / after
Empty
HOME,install --no-tui:Testing
src/cli.test.tsruns the realinstall --no-tuiagainst an empty temporary home. It fails onmainwith the exactENOENTand passes with this change.bun run typecheckis clean andbun testpasses (34 tests).opencode.jsonc,tui.jsonc,supermemory.jsonand the command files.