OpenCode Go plugin thumbnail

OpenCode Go

Adds OpenCode Go and Zen model gateway providers to Agent Zero model configuration.

Author 3clyp50 2 stars Version 0.1.4 Updated

README

OpenCode Go

Adds OpenCode Go and Zen as plugin-owned model gateway providers for Agent Zero.

Providers

  • opencode_zen uses the OpenAI-compatible OpenCode Zen endpoint for models documented with /chat/completions.
  • opencode_zen_anthropic uses the Anthropic-compatible OpenCode Zen endpoint for models documented with /messages.
  • opencode_go uses the OpenAI-compatible OpenCode Go endpoint for models documented with /chat/completions (GLM, Kimi, DeepSeek, and MiMo).
  • opencode_go_anthropic uses the Anthropic-compatible OpenCode Go endpoint for models documented with /messages (MiniMax and Qwen).

OpenCode publishes the live model catalog at /models for each gateway. The provider metadata filters that catalog by protocol so Agent Zero only suggests models that match the selected LiteLLM provider family.

API Keys

Paste the API key from your OpenCode account into the corresponding provider row in Model Configuration. Go and Zen use different base URLs but the same OpenCode account key format.

The plugin also accepts a shared OPENCODE_API_KEY / API_KEY_OPENCODE environment value. If the Anthropic-compatible Zen or Go entry does not have its own key, it falls back to the matching opencode_zen or opencode_go key, then to the shared opencode key.

Model names in Agent Zero

Use the exact OpenCode model ID in the Agent Zero model field. Do not include the OpenCode config provider prefix.

For example, to use MiniMax M2.7:

  • Provider: OpenCode Go (MiniMax/Qwen)
  • Model: minimax-m2.7

Do not enter opencode-go/minimax-m2.7, MiniMax M2.7, or MiniMax-M2.7 as the Agent Zero model name. Those are OpenCode UI/config labels, while the API expects the lowercase model ID.

Updating

The hooks.py lifecycle hook is named pre_update(). Before an update, it moves an untracked webui/thumbnail.webp downloaded by Plugin Hub to webui/thumbnail.webp.pre-update-backup. Tracked thumbnails and other local files are left alone. An existing backup is never overwritten; move it elsewhere before retrying if the hook reports a backup conflict.

Versions before 0.1.4 do not contain this hook. Agent Zero runs the installed hook before pulling, so publishing it cannot automatically unblock those versions. If their full Git error lists the untracked file webui/thumbnail.webp, move only that file aside, then retry Update in Plugin Hub. For a standard Docker installation, run this inside the Agent Zero container:

mv -n -- /a0/usr/plugins/a0_opencode_go/webui/thumbnail.webp \
  /a0/usr/plugins/a0_opencode_go/webui/thumbnail.webp.pre-update-backup

If that backup already exists, move it elsewhere first. If Git lists other conflicting files, preserve and inspect those separately.