Skip to content

feat(models): add OpenCode Go provider - #3866

Open
DaweiTian wants to merge 10 commits into
langgenius:mainfrom
DaweiTian:main
Open

feat(models): add OpenCode Go provider#3866
DaweiTian wants to merge 10 commits into
langgenius:mainfrom
DaweiTian:main

Conversation

@DaweiTian

@DaweiTian DaweiTian commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Add a new OpenCode Go model provider for Dify.

OpenCode Go recently introduced stricter client requirements for its gateway. This plugin implements them natively so Dify apps can call Go models without being treated as a generic/abusive client.

OpenCode Go API client requirements → how this plugin addresses them

OpenCode Go requirement Implementation
Identify the client with a dedicated User-Agent (not a generic SDK/HTTP library name) Sends User-Agent: dify-opencode-go-plugin/0.1.0 on every request
Send a stable session id per conversation in x-opencode-session for routing & prompt-cache affinity Sends x-opencode-session: dify-opencode-go/<client-id>/<dify-user> — namespaced, collision-resistant, stable per Dify user (avoids bare ids like est-user / short numeric ids that can collide across workspaces)
Typical coding-agent traffic against the Go OpenAI-compatible endpoint Uses POST {base}/chat/completions with default https://opencode.ai/zen/go/v1

Reference: OpenCode Go — Where can I use it?

What else is included

  • Predefined models from the Go catalog: GLM-5.x, Kimi K2/K3, DeepSeek V4, MiMo-V2.5, MiniMax M3/M2.x, Qwen3.x, LongCat-2.0, Hy3/Hy4, and more
  • Custom model configuration for newly added model IDs
  • Streaming and non-streaming completions
  • Tool / function calling on supported models
  • Official OpenCode logo assets (light/dark)

Release Notes

  • Add OpenCode Go as a new LLM model provider
  • Comply with OpenCode Go client requirements: dedicated User-Agent and namespaced x-opencode-session header for routing and prompt caching
  • Bundle predefined models from the OpenCode Go catalog
  • Support custom model IDs for newly added gateway models

Change Type

  • Documentation / non-plugin change
  • Non-LLM plugin (tools, extensions, datasource, etc.)
  • LLM plugin

Screenshots / Videos

Before After
OpenCode Go models unavailable in Dify OpenCode Go provider with curated coding models

LLM Plugin Checklist

Areas affected by this change (check all that apply)
  • Message flow (system messages, user ↔ assistant turn-taking)
  • Tool interaction flow (multi-round usage, Agent App and Agent Node)
  • Multimodal input (images, PDFs, audio, video, etc.)
  • Multimodal output (images, audio, video, etc.)
  • Structured output (JSON, XML, etc.)
  • Token consumption metrics
  • Other LLM functionality (reasoning, grounding, prompt caching, etc.)
  • New models / model parameter fixes

Version

  • Bumped top-level version in manifest.yaml (not the one under meta)
  • dify_plugin declared in pyproject.toml

Testing

  • Local deployment — Dify version: self-hosted
  • SaaS (cloud.dify.ai)

Verified against a live OpenCode Go key:

  • GET /zen/go/v1/models returns the catalog
  • Non-stream and stream chat/completions succeed for GLM / Kimi / DeepSeek / MiMo / Qwen / Hy / MiniMax M3
  • Request headers include the dedicated User-Agent and namespaced x-opencode-session
  • Models that only speak the OpenAI Responses API (e.g. Grok 4.6, GPT 5.6 Luna) are intentionally excluded from predefined models

Docs: https://opencode.ai/docs/go/

…ls over an OpenAI-compatible API.

OpenCode Go is a low-cost ($10/month) subscription gateway from OpenCode that gives reliable access to curated open coding models. This Dify plugin exposes those models as a first-class LLM provider.

What you get
• Predefined models from the OpenCode Go catalog (GLM-5.x, Kimi K2/K3, DeepSeek V4, MiMo-V2.5, MiniMax M3/M2.x, Qwen3.x, LongCat-2.0, Hy3/Hy4, and more)
• Custom model support for newly added model IDs
• Streaming and non-streaming chat completions
• Tool / function calling on models that support it
• Default base URL: https://opencode.ai/zen/go/v1

OpenCode Go client requirements
OpenCode Go asks clients to identify themselves and send a stable session id. This plugin automatically includes:
• User-Agent: dify-opencode-go-plugin/0.1.0 (not a generic SDK name)
• x-opencode-session: dify-opencode-go/<client-id>/<dify-user> — collision-resistant and stable per Dify user

Setup
1. Subscribe to OpenCode Go at https://opencode.ai/auth and copy your API key.
2. Install this plugin in Dify.
3. Go to Settings → Model Providers → OpenCode Go, paste the API key, and save.
4. Select an OpenCode Go model in your app.

Notes
• This plugin uses the OpenAI-compatible path (POST {base}/chat/completions).
• Some gateway models that only speak the OpenAI Responses API (e.g. Grok 4.6, GPT 5.6 Luna) are not included as predefined models.
• Unofficial community plugin. Not affiliated with OpenCode / Anomaly or Dify.
• Docs: https://opencode.ai/docs/go/
crazywoola
crazywoola previously approved these changes Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants