codegraph icon indicating copy to clipboard operation
codegraph copied to clipboard

Wrong OpenCode init

Open PVLPM opened this issue 6 months ago • 2 comments

Init with OpenCode creates its own config for MCP and AGENTS.md in C:\Users\User\AppData\Roaming\OpenCode instead of the real config file, which is usually C:\Users\User\.config\opencode on Windows. AGENTS.md should be or as SKILL.md (for global unified usage, but less reliable), or find/ask the projects where to inject instructions into the existing AGENTS.md.

PVLPM avatar May 19 '26 20:05 PVLPM

Can confirm this exact issue on Windows with OpenCode v1.15.10 + CodeGraph v0.9.4.

Installer wrote to %APPDATA%\opencode\opencode.jsonc but OpenCode actually reads from ~\.config\opencode\opencode.jsonc. The AGENTS.md went to the wrong location too. After codegraph install --target=opencode --yes appeared successful, the MCP server never loaded.

Manual fix:

  • Copied MCP config block to ~\.config\opencode\opencode.jsonc
  • Merged CodeGraph instructions into ~\.config\opencode\AGENTS.md (the existing file, not the one installer created)
  • Deleted the orphaned files from %APPDATA%\opencode\

PR #192 would fix this — hope it gets merged soon.

skywalker-35 avatar May 25 '26 15:05 skywalker-35

This is the same bug as #535 — on Windows the opencode installer writes to %APPDATA%\opencode\, but opencode actually reads ~/.config/opencode/ on all platforms, so the MCP config never loads. #535 has a clear repro and a third-party confirmation, so I'm consolidating there.

Closing this as a duplicate of #535 — please follow that one for the fix. Thanks for reporting it.

colbymchenry avatar May 29 '26 04:05 colbymchenry