Skip to content

feat: add OpenCode Zen provider (opencode/ prefix)#753

Open
mqyang56 wants to merge 1 commit intosipeed:mainfrom
mqyang56:feat/opencode-zen-provider
Open

feat: add OpenCode Zen provider (opencode/ prefix)#753
mqyang56 wants to merge 1 commit intosipeed:mainfrom
mqyang56:feat/opencode-zen-provider

Conversation

@mqyang56
Copy link

Summary

Closes #752

Adds OpenCode Zen as a new LLM provider. OpenCode Zen is a curated model gateway by the OpenCode team supporting 30+ models (GPT-5, Claude, Gemini, etc.) via a single API key.

  • New protocol prefix: opencode/
  • API base: https://opencode.ai/zen/v1 (OpenAI-compatible)
  • Zero new dependencies — reuses existing HTTPProvider

Changes

  • pkg/providers/factory_provider.go — add opencode case and default API base
  • pkg/providers/factory_provider_test.go — add test coverage
  • config/config.example.json — add example entry
  • README*.md (6 languages) — update vendor table and add config snippet

Test plan

  • go test ./pkg/providers/ -run TestCreateProviderFromConfig passes
  • Manual test with a real OpenCode Zen API key

Add support for OpenCode Zen as a new LLM provider gateway.
- Protocol prefix: opencode/
- Default API base: https://opencode.ai/zen/v1
- Supports 30+ models (GPT-5, Claude, Gemini, etc.) via OpenAI-compatible API
- Update all README variants and config.example.json with usage examples
Copilot AI review requested due to automatic review settings February 25, 2026 02:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds OpenCode Zen as a new LLM provider to PicoClaw, enabling users to access 30+ AI models (GPT-5, Claude, Gemini, etc.) through a single API key via the OpenCode Zen gateway. The implementation follows the established pattern for OpenAI-compatible providers by reusing the existing HTTPProvider infrastructure with zero new dependencies.

Changes:

  • Added opencode protocol prefix support with default API base https://opencode.ai/zen/v1
  • Updated test coverage to include the new provider
  • Added configuration examples across documentation files

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/providers/factory_provider.go Added opencode to OpenAI-compatible providers case and registered default API base URL
pkg/providers/factory_provider_test.go Added test case for opencode protocol in default API base test
config/config.example.json Added example configuration for OpenCode Zen with sample model and API key placeholder
README.md Added OpenCode Zen to provider table and included vendor-specific configuration example
README.zh.md Added OpenCode Zen to provider table and included vendor-specific configuration example in Chinese
README.vi.md Added OpenCode Zen to provider table (missing vendor-specific config example)
README.pt-br.md Added OpenCode Zen to provider table (missing vendor-specific config example)
README.ja.md Added OpenCode Zen to provider table (missing vendor-specific config example)
README.fr.md Added OpenCode Zen to provider table (missing vendor-specific config example)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [キーを取得](https://cerebras.ai) |
| **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [キーを取得](https://console.volcengine.com) |
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
| **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [キーを取得](https://opencode.ai/zen) |
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this Japanese variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).

Copilot uses AI. Check for mistakes.
| **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Obtenir Clé](https://cerebras.ai) |
| **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Obtenir Clé](https://console.volcengine.com) |
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
| **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Obtenir Clé](https://opencode.ai/zen) |
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this French variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).

Copilot uses AI. Check for mistakes.
| **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Lấy Khóa](https://cerebras.ai) |
| **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Lấy Khóa](https://console.volcengine.com) |
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
| **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Lấy Khóa](https://opencode.ai/zen) |
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from the other language variants (README.vi.md, README.pt-br.md, README.ja.md, and README.fr.md). For consistency, the configuration example section should be added to all README variants following the same pattern used in the English and Chinese versions.

Copilot uses AI. Check for mistakes.
| **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Obter Chave](https://cerebras.ai) |
| **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Obter Chave](https://console.volcengine.com) |
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
| **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Obter Chave](https://opencode.ai/zen) |
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this Portuguese variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).

Copilot uses AI. Check for mistakes.
@xiaket xiaket added enhancement New feature or request domain: provider labels Feb 25, 2026
Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal provider addition. The opencode protocol reuses the existing HTTPProvider (OpenAI-compatible), adds a default API base, updates docs across 6 languages, adds example config, and has test coverage.

No concerns — this follows the exact same pattern as every other OpenAI-compatible provider in the codebase. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: provider enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add OpenCode Zen provider (opencode/ prefix)

4 participants