wigolo icon indicating copy to clipboard operation
wigolo copied to clipboard

opencode: verify/finish MCP wiring or remove from the agent list (unverified format, no instructions handler, unmarketed)

Open KnockOutEZ opened this issue 4 months ago • 1 comments

Surfaced while fixing the antigravity agent-support bug (#155). opencode is the inverse case: it's offered by the CLI but only partially built and unverified.

Current state

  • In KNOWN_AGENT_IDS (src/cli/tui/flags-types.ts) → --agents=opencode is accepted and it shows up in the "Valid:" list on a bad --agents value.
  • Has a detection descriptor (src/cli/tui/agents.ts) → detectAgents() returns it; configPath ~/.config/opencode/config.json.
  • In JSON_SPECS (src/cli/tui/config-writer.ts) → applyConfigs writes { command: 'npx', args: ['-y','wigolo'], type: 'local' } at key path mcp.wigolo.
  • No registry handler (src/cli/agents/ has no opencode.ts) → init's instructions loop hits if (!handler) continue and silently skips the instructions block.
  • Not marketed anywhere (absent from README, site, llms.txt).

Concerns to verify against real OpenCode

  1. Config format looks wrong. OpenCode's documented MCP schema expects command as an array ("command": ["npx","-y","wigolo"]) plus "enabled": true, whereas wigolo writes a command string + separate args (the mcpServers-style shape). If so, the config wigolo writes won't load in OpenCode.
  2. Config filename/path. OpenCode typically reads opencode.json (project) or ~/.config/opencode/opencode.json, not ~/.config/opencode/config.json. Confirm the correct location.
  3. No instructions layer (the silent-skip). Either add an opencodeHandler (registry) or accept MCP-only with no instructions.

Options

  • Finish it: add an opencode.ts registry handler (or a config-writer branch) that writes the correct OpenCode schema to the correct file, verify end-to-end against a real OpenCode install, then add it to the marketed agent list.
  • Remove it: drop opencode from KNOWN_AGENT_IDS, the detection descriptor, and the AgentId type until it's verified — so the CLI stops offering an agent it can't correctly wire.

Notes

  • The consistency guard added in #155 (tests/unit/cli/agents/agent-support-consistency.test.ts) currently PASSES for opencode (it has a config-writer path) — it guards seam presence, not format correctness. Whichever option is chosen, keep that test green.
  • Related dead code (separate cleanup): the per-agent registry handlers each define an installMcp that nothing calls; the live MCP writer is config-writer.ts. Worth removing the vestigial installMcp to avoid future confusion.

KnockOutEZ avatar Jul 12 '26 19:07 KnockOutEZ

I opened #204 with a focused OpenCode integration fix. It writes the documented global schema, migrates the owned legacy entry safely, and adds precise uninstall, status, backup, and failure-path coverage. The targeted suite, lint, build, and a real OpenCode MCP smoke check are passing.

HsiangNianian avatar Jul 19 '26 12:07 HsiangNianian