Summary
getMcpConfig() in service/poller.js hard-codes the config path to ~/.config/opencode/opencode.json and parses it with strict JSON.parse. OpenCode officially supports opencode.jsonc (JSONC, with comments) as an equal alternative — for users whose global config is the .jsonc variant, every generic/Linear source fails at poll time.
Reproduction
- Global OpenCode config at
~/.config/opencode/opencode.jsonc (JSONC, contains comments). No opencode.json present.
- Configure a Linear source (preset
linear/my-issues) with a valid mcp: linear server defined in that config.
opencode-pilot test-source <name>
Result
Error fetching items: MCP config not found: /Users/<user>/.config/opencode/opencode.json
at getMcpConfig (file:///.../opencode-pilot/service/poller.js:205:11)
at pollGenericSource (file:///.../opencode-pilot/service/poller.js:335:21)
Expected
Pilot resolves the MCP config the same way OpenCode itself does: try opencode.json, fall back to opencode.jsonc, and parse with a comment-tolerant parser (e.g. strip-json-comments or a small JSONC parser) rather than strict JSON.parse (poller.js:208).
Note options.opencodeConfigPath exists internally (poller.js:318) but doesn't appear to be settable from config.yaml, so there's no user-side workaround short of maintaining a duplicate plain-JSON config — which OpenCode may itself read, with unclear precedence against the jsonc file.
Version
opencode-pilot 0.29.1 (npm), OpenCode 1.18.18, macOS.
Summary
getMcpConfig()inservice/poller.jshard-codes the config path to~/.config/opencode/opencode.jsonand parses it with strictJSON.parse. OpenCode officially supportsopencode.jsonc(JSONC, with comments) as an equal alternative — for users whose global config is the.jsoncvariant, every generic/Linear source fails at poll time.Reproduction
~/.config/opencode/opencode.jsonc(JSONC, contains comments). Noopencode.jsonpresent.linear/my-issues) with a validmcp: linearserver defined in that config.opencode-pilot test-source <name>Result
Expected
Pilot resolves the MCP config the same way OpenCode itself does: try
opencode.json, fall back toopencode.jsonc, and parse with a comment-tolerant parser (e.g. strip-json-comments or a small JSONC parser) rather than strictJSON.parse(poller.js:208).Note
options.opencodeConfigPathexists internally (poller.js:318) but doesn't appear to be settable fromconfig.yaml, so there's no user-side workaround short of maintaining a duplicate plain-JSON config — which OpenCode may itself read, with unclear precedence against the jsonc file.Version
opencode-pilot 0.29.1 (npm), OpenCode 1.18.18, macOS.