fix(installer): use opencode config dir on Windows
Summary
- Route global opencode installs to
~/.config/opencodeon Windows instead of%APPDATA%/opencode. - Keep the existing
XDG_CONFIG_HOMEoverride behavior for global installs. - Add a Windows regression test that sets
APPDATAand verifies CodeGraph writes bothopencode.jsoncandAGENTS.mdunder~/.config/opencode. - Make one existing local opencode path assertion separator-agnostic so the installer target test runs cleanly on Windows.
Closes #186.
Why
OpenCode documents the global config path as ~/.config/opencode/opencode.json, and #186 reports that the installer-created %APPDATA%/opencode config is not the file OpenCode reads on Windows. That makes codegraph install --target=opencode appear successful while the MCP server and instructions do not load.
Duplicate check
Checked recent/open PRs for opencode. #162 and #163 already merged the multi-target installer and .jsonc/AGENTS.md support, but they do not address the Windows %APPDATA% path. I did not find an open PR covering #186.
Test plan
node node_modules/vitest/vitest.mjs run __tests__/installer-targets.test.ts— 57 passednode node_modules/typescript/bin/tsc --noEmit
Confirmed this fixes a real bug — hit it today on Windows with OpenCode v1.15.10 and CodeGraph v0.9.4. The installer's %APPDATA%\opencode\ output looks successful but OpenCode silently ignores it. Had to manually move config to ~\.config\opencode\ to get the MCP server loading.
Tests pass cleanly, and this is blocking every Windows + OpenCode user from a working install. Any chance this can be merged soon?
Thanks for confirming, @skywalker-35. I rebased this on the latest main and resolved the test conflict; GitHub now shows the PR as mergeable again.
Validation:
node node_modules/vitest/vitest.mjs run __tests__/installer-targets.test.ts(83 passed)node node_modules/typescript/bin/tsc --noEmit
@colbymchenry this should be ready for another look/merge when you have a chance.
Will this be merged soon? Thank you :)