Skip to content

feat(llm): add OpenCode Zen polish provider, default deepseek-v4-flash - #1023

Merged
H-Chris233 merged 8 commits into
Open-Less:betafrom
zhou-zhichao:feat/opencode-llm-provider
Sep 8, 2026
Merged

feat(llm): add OpenCode Zen polish provider, default deepseek-v4-flash#1023
H-Chris233 merged 8 commits into
Open-Less:betafrom
zhou-zhichao:feat/opencode-llm-provider

Conversation

@zhou-zhichao

@zhou-zhichao zhou-zhichao commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Goal

OpenCode is available as a Less Computer CLI backend, but is missing from Settings → AI providers for dictation polish. Add OpenCode Zen as a polish LLM provider with deepseek-v4-flash over the OpenAI-compatible /zen/v1/chat/completions endpoint.

Usage

  1. Settings → AI providers → add channel → OpenCode Zen
  2. Paste an OpenCode API key from https://opencode.ai/auth
  3. Keep the model as deepseek-v4-flash

For an OpenCode Go subscription, change the same card's Base URL to https://opencode.ai/zen/go/v1 and use the Go console key.

The thinking toggle uses DeepSeek's thinking.type (off by default). A custom endpoint whose host contains opencode.ai gets the same fallback.

Implementation

  • Register OpenCode in the shared Core cloud provider list and provider descriptors, including its default endpoint, model, and credential policy.
  • Keep thinking controls and their tests in crates/openless-core/src/polish.rs.
  • Add the frontend label and translations; channel defaults come from Core descriptors.

Verification

Run from openless-all/app:

  • cargo test --locked -p openless-core — 886 passed, 1 ignored.
  • npm run build — TypeScript and Vite build passed.
  • node scripts/frontend-test-runner.mjs — all 69 test files passed.

Regression coverage includes provider registration and defaults, API key requirements at the default endpoint, thinking enabled/disabled for the preset and a custom Go endpoint, and frontend consumption of Core defaults.

Scope

Does not change Less Computer / OpenCode CLI, and does not change ASR.

@zhou-zhichao zhou-zhichao changed the title feat(llm): 增加 OpenCode Zen 润色提供商,默认 deepseek-v4-flash feat(llm): add OpenCode Zen polish provider, default deepseek-v4-flash Sep 2, 2026
Dictation polish uses OpenAI-compatible chat/completions. For OpenCode Go, change the Base URL to /zen/go/v1.
@zhou-zhichao
zhou-zhichao force-pushed the feat/opencode-llm-provider branch from e4a14cc to 4cfacf1 Compare September 2, 2026 01:20
@H-Chris233 H-Chris233 self-assigned this Sep 7, 2026
@H-Chris233

Copy link
Copy Markdown
Collaborator

开始审查

@H-Chris233

Copy link
Copy Markdown
Collaborator

暂缓合并本 PR,优先完成 #1039。OpenCode Zen 的模型分别使用 Chat Completions、Responses 和 Messages,而当前实现固定走 Chat Completions。待 #1039 支持按渠道手动选择请求格式后,再更新本 PR 并验证各协议路径。

MarkShawn2020 and others added 2 commits September 8, 2026 01:39
Auto 和 Toggle 模式只在 Fn 短按松开且未叠加功能层操作时触发听写;长按及亮度、音量等 systemDefined 事件留给 macOS。

保留显式 Hold 模式的按住说话语义,并跳过 Fn 短按释放后的冗余仲裁延迟。

Co-authored-by: Chris233 <h-chris233@outlook.com>
* fix(asr): 百炼 WebSocket 优先走 IPv4,避开本机 IPv6 黑洞

dashscope 的 AAAA 在部分 Windows 双栈网上 TCP 443 会挂死,connect_async 先试 IPv6 会卡满 5 秒超时,听写进不了 Listening。

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(asr): preserve websocket ports and retry handshake addresses

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Chris233 <h-chris233@outlook.com>
@H-Chris233

Copy link
Copy Markdown
Collaborator

预想为Opencode Zen在预设中可以手动选择请求该模型的格式,用户可以自行测试哪种格式适合该模型。

* fix(updater): default beta builds to beta channel (Open-Less#1034)

* fix(updater): persist channel switches atomically
* feat(llm): add channel request formats and compatibility presets

* fix(llm): harden channel protocol handling
@H-Chris233

Copy link
Copy Markdown
Collaborator

#1042 已合并,现在开始改造该PR

@H-Chris233
H-Chris233 merged commit a3fc717 into Open-Less:beta Sep 8, 2026
4 checks passed
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.

4 participants