Skip to content

feat(provider): Support integration with OpenCode#2463

Open
lhpqaq wants to merge 6 commits intoagentscope-ai:mainfrom
lhpqaq:feat/opencode
Open

feat(provider): Support integration with OpenCode#2463
lhpqaq wants to merge 6 commits intoagentscope-ai:mainfrom
lhpqaq:feat/opencode

Conversation

@lhpqaq
Copy link
Copy Markdown

@lhpqaq lhpqaq commented Mar 28, 2026

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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Core / Backend (app, agents, config, providers, utils, local_models)
  • Console (frontend web UI)
  • Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
  • Skills
  • CLI
  • Documentation (website)
  • Tests
  • CI/CD
  • Scripts / Deploy

Checklist

  • I ran pre-commit run --all-files locally and it passes
  • If pre-commit auto-fixed files, I committed those changes and reran checks
  • I ran tests locally (pytest or as relevant) and they pass
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Local Verification Evidence

pre-commit run --all-files
# paste summary result

pytest
# paste summary result

Additional Notes

[Optional: any other context]

Copilot AI review requested due to automatic review settings March 28, 2026 16:52
@github-actions github-actions bot added the first-time-contributor PR created by a first time contributor label Mar 28, 2026
@github-actions
Copy link
Copy Markdown

Welcome to CoPaw! 🐾

Hi @lhpqaq, thank you for your first Pull Request! 🎉

🙌 Join Developer Community

Thanks 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:
https://copaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.


Tip

⭐ If you find CoPaw useful, please give us a Star!

Star CoPaw

Staying ahead

Star CoPaw on GitHub and be instantly notified of new releases.

Your star helps more developers discover this project! 🐾

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
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

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 opencode as a built-in OpenAIProvider in ProviderManager (base URL https://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.

Copilot AI review requested due to automatic review settings March 29, 2026 08:07
Copy link
Copy Markdown
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

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.

Copy link
Copy Markdown
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

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.

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

Labels

first-time-contributor PR created by a first time contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants