Description
When both opencode.json and opencode.jsonc exist in the config directory, OpenCode silently merges them. A partial .jsonc can override specific keys from a full .json without any indication to the user.
In my case, opencode.json had the correct MCP config for Engram:
"engram": {
"command": ["/usr/local/bin/engram", "mcp", "--tools=agent"]
}
But opencode.jsonc (leftover from a previous setup) had:
"engram": {
"command": ["/usr/local/Cellar/engram/1.16.1/bin/engram", "mcp", "--tools=agent"]
}
This caused a confusing ENOENT error pointing to a path that didn't exist (1.16.1), even though the .json file was correct.
Expected
Either:
- Document the precedence/merge behavior clearly (which file wins when both exist?)
- Warn when a partial config overrides specific keys from the other file
- Or discourage having two config files with conflicting MCP entries
Additional context
The error message (ENOENT: no such file or directory, posix_spawn '/usr/local/Cellar/engram/1.16.1/bin/engram') didn't hint that the problem was a stale config file or a merge conflict — it looked like a missing binary.
Plugins
engram.ts, model-variants.ts, skill-registry.ts, gentle-logo.tsx
OpenCode version
1.17.7
Steps to reproduce
- Create ~/.config/opencode/opencode.json with a correct MCP entry:
"mcp": {
"engram": {
"command": ["/usr/local/bin/engram", "mcp"],
"type": "local"
}
}
- Create ~/.config/opencode/opencode.jsonc with a partial override of the same MCP server pointing to a non-existent path:
"mcp": {
"engram": {
"command": ["/usr/local/Cellar/engram/1.16.1/bin/engram", "mcp"],
"type": "local"
}
}
- Launch OpenCode.
- Observed: the MCP server silently fails with ENOENT. No warning that a second config file exists, no indication of the merge happening, and no hint about which file takes precedence.
Screenshot and/or share link
Operating System
MacOS 26.5.1
Terminal
iTerm2 Build 3.6.11
Description
When both
opencode.jsonandopencode.jsoncexist in the config directory, OpenCode silently merges them. A partial.jsonccan override specific keys from a full.jsonwithout any indication to the user.In my case,
opencode.jsonhad the correct MCP config for Engram:But opencode.jsonc (leftover from a previous setup) had:
This caused a confusing ENOENT error pointing to a path that didn't exist (1.16.1), even though the .json file was correct.
Expected
Either:
Additional context
The error message (ENOENT: no such file or directory, posix_spawn '/usr/local/Cellar/engram/1.16.1/bin/engram') didn't hint that the problem was a stale config file or a merge conflict — it looked like a missing binary.
Plugins
engram.ts, model-variants.ts, skill-registry.ts, gentle-logo.tsx
OpenCode version
1.17.7
Steps to reproduce
Screenshot and/or share link
Operating System
MacOS 26.5.1
Terminal
iTerm2 Build 3.6.11