feat(provider): Support integration with OpenCode#2463
feat(provider): Support integration with OpenCode#2463lhpqaq wants to merge 6 commits intoagentscope-ai:mainfrom
Conversation
|
Hi @lhpqaq, thank you for your first Pull Request! 🎉 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official CoPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
There was a problem hiding this comment.
Code Review
This pull request introduces the 'OpenCode' LLM provider, adding support across the frontend configuration modals, backend provider management, and documentation. The review feedback identifies critical issues in the new unit tests, specifically that several models being tested or activated are missing from the provider's defined model list. There are also recommendations to improve code maintainability by refactoring series of conditional statements into map-based lookups in the frontend and ensuring consistent sequential numbering in the provider baseline documentation.
console/src/pages/Settings/Models/components/modals/ProviderConfigModal.tsx
Show resolved
Hide resolved
console/src/pages/Settings/Models/components/modals/ProviderConfigModal.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds a first-class built-in OpenCode (Zen) provider so CoPaw can talk to OpenCode’s OpenAI-compatible endpoint, with accompanying console hints, baseline capability annotations, docs, and unit tests.
Changes:
- Add
opencodeas a built-inOpenAIProviderinProviderManager(base URLhttps://opencode.ai/zen/v1) and register baseline capabilities. - Update docs (EN/ZH) to list OpenCode as a cloud/built-in provider and add a dedicated OpenCode section.
- Add unit tests for OpenCode provider registration/config and basic connectivity.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website/public/docs/models.zh.md | Documents OpenCode provider setup (console + CLI) in Chinese. |
| website/public/docs/models.en.md | Documents OpenCode provider setup (console + CLI) in English. |
| website/public/docs/config.zh.md | Adds OpenCode row to built-in providers table (ZH). |
| website/public/docs/config.en.md | Adds OpenCode row to built-in providers table (EN). |
| tests/unit/providers/test_opencode_provider.py | New unit tests for the OpenCode provider/built-in registration. |
| src/copaw/providers/provider_manager.py | Introduces OPENCODE_MODELS, PROVIDER_OPENCODE, and registers it as a built-in provider. |
| src/copaw/providers/capability_baseline.py | Adds OpenCode expected capability baseline entries; updates baseline docstring. |
| console/src/pages/Settings/Models/components/modals/ProviderConfigModal.tsx | Adds OpenCode endpoint hint/placeholder handling in provider config modal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
console/src/pages/Settings/Models/components/modals/ProviderConfigModal.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Description
[Describe what this PR does and why]
I’ve taken task 16 in #2292 to implement native support for opencode zen (https://opencode.ai/zh/zen), and #2428 appears to be based on a reverse proxy.
Related Issue: Fixes #(issue_number) or Relates to #(issue_number)
Security Considerations: [If applicable, e.g. channel auth, env/config handling]
Type of Change
Component(s) Affected
Checklist
pre-commit run --all-fileslocally and it passespytestor as relevant) and they passTesting
[How to test these changes]
Local Verification Evidence
Additional Notes
[Optional: any other context]