Repository navigation
Conversation
…tead of cwd (Graphify-Labs#1412) `graphify install --platform opencode` (without --project) previously called `_install_opencode_plugin(Path("."))`, which resolved the plugin destination against the current working directory. opencode resolves `.opencode/plugins/<name>.js` entries relative to the declaring config's directory — and the global config lives at `~/.config/opencode/opencode.json`, not cwd. So the installer wrote: ~/.opencode/plugins/graphify.js ← orphan (cwd happened to be ~) ~/.opencode/opencode.json ← orphan config declaring the plugin …neither of which opencode loads. The installer's "plugin registered" message was false-positive in global mode. Fix: thread `project: bool` into `_install_opencode_plugin` / `_uninstall_opencode_plugin`. When False (global), resolve base dir via `Path.home() / ".config" / "opencode"` — matching the existing skill-path resolution that already worked correctly. When True (default, used by `_agents_install` etc.), behaviour is unchanged. The plugin FILE always lands at `<base>/.opencode/plugins/graphify.js` (auto-discovered + relative-path-resolvable from the config). The CONFIG REGISTRATION path differs by mode: - project mode: `<project>/.opencode/opencode.json` (one of three valid project-config paths opencode walks up from cwd to find) - global mode: `<base>/opencode.json` — i.e. `~/.config/opencode/opencode.json`, opencode's ONLY global config location. Writing it to `<base>/.opencode/opencode.json` (the obvious symmetric choice) is a silent no-op: that path is neither a project config nor the global config. Messages now print the resolved absolute path so users can see where the plugin actually landed. Regression tests cover: plugin lands at `~/.config/opencode/.opencode/plugins/graphify.js`, registration goes into `~/.config/opencode/opencode.json` (with an explicit assertion that no plugin entry leaks into a phantom `<base>/.opencode/opencode.json`), and global uninstall removes both.
WSHAPER
force-pushed
the
fix/opencode-global-install-path
branch
from
June 21, 2026 08:51
2b6a500 to
c8e92ab
Compare
safishamsi
requested changes
Jun 22, 2026
safishamsi
left a comment
Member
There was a problem hiding this comment.
The helper rewrite is sound, but this doesn't fix the reported bug for the documented command. There are two opencode install entry points:
install()(graphify install --platform opencode) — patched here ✅_agents_install()(graphify opencode install, dispatch ~__main__.py:2511) — not patched. It still calls_install_opencode_plugin(project_dir or Path("."))with the defaultproject=True, sographify opencode install(no--project) still writes to<cwd>/.opencode/— exactly #1412.
Please thread project= through the _agents_install call site, and the uninstall sites (~1710/1719/1738/1873) which still default to project-scope (a global uninstall won't clean ~/.config/opencode/). The added tests drive install() only — please add one driving _agents_install global so the primary command path is covered.
Note: #1415 edits the same region — whichever merges second will need a rebase.
This branch has not been deployed
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 #1412.
Summary
Running
graphify install --platform opencodewithout--project(the documented global-install mode) wrote the plugin to<cwd>/.opencode/plugins/graphify.jsand created a stray<cwd>/.opencode/opencode.json. Neither file is loaded by opencode — opencode resolves.opencode/plugins/<name>.jsentries relative to the declaring config's directory, and the global config lives at~/.config/opencode/opencode.json, not cwd.The installer log claimed success (
tool.execute.before hook written,plugin registered), but the plugin silently never loaded. This is the global-mode sibling of #1040 (which was the--projectvariant of the same class of bug).Root cause
graphify/__main__.pyline 697 (v0.8.44):For global installs (
project=False), this resolved the plugin destination againstPath(".")— the current working directory. Run from~, the plugin landed at~/.opencode/plugins/graphify.js. Run from any other cwd, it landed wherever the user happened to be.Meanwhile, the skill install path (line 148-151) already handled both modes correctly:
The plugin install path simply didn't have the same branching — it always used
project_dirregardless of mode.Fix
Thread
project: bool = Trueinto_install_opencode_plugin/_uninstall_opencode_plugin. Whenproject=False, resolve base dir viaPath.home() / ".config" / "opencode"(matching the existing skill-path logic, monkey-patchable in tests viaPath.home). Whenproject=True(default, used by_agents_installetc.), behaviour is unchanged.Only the global-mode caller (
install()at line 697) passes the new flag; the five other callers (_agents_install,_agents_uninstall× 3,uninstall_all) are project-scoped by design and use the default.Also: the install/uninstall messages now print the resolved absolute path so users can see where the plugin actually landed (previously they saw the relative
.opencode/plugins/graphify.jswhich gave no clue about which tree it was written to).Verification
Three new regression tests:
test_install_opencode_global_writes_plugin_to_config_dir— after global install, plugin exists at~/.config/opencode/.opencode/plugins/graphify.jsand there is no stray<cwd>/.opencode/tree.test_install_opencode_global_registers_plugin_in_config— registration goes into~/.config/opencode/.opencode/opencode.json, not a stray cwd-relative file.test_uninstall_opencode_global_removes_plugin— global uninstall (project=False) removes the plugin from the correct location.All 12 opencode install tests pass; no regressions in the broader install/roundtrip/upgrade/reference suites (156 tests pass).
Workaround for users on already-released versions
Related
--projectflag creates non-discoverable skill path for OpenCode platform #1040 —--projectvariant of the same bug class (project-mode skill path was wrong; this PR fixes the corresponding global-mode plugin path)customize-opencodeskill both clearly distinguish~/.config/opencode/(config) from~/.opencode/(runtime/binary).