Skip to content

feat(llm): 支持渠道级 Chat Completions、Responses 和 Messages - #1042

Merged
H-Chris233 merged 3 commits into
Open-Less:betafrom
H-Chris233:codex/feat-1039-llm-request-formats
Sep 8, 2026
Merged

feat(llm): 支持渠道级 Chat Completions、Responses 和 Messages#1042
H-Chris233 merged 3 commits into
Open-Less:betafrom
H-Chris233:codex/feat-1039-llm-request-formats

Conversation

@H-Chris233

Copy link
Copy Markdown
Collaborator

变更

普通 LLM 渠道此前固定使用 Chat Completions,无法连接要求 Responses 或 Messages 的模型。本 PR 增加渠道级请求格式选择,由 Core 统一构造请求、鉴权并解析非流式与 SSE 正文;润色、重润色、问答、翻译及连接测试使用同一协议配置。

  • 保留现有 custom,新增 Responses、Messages 两个兼容预设。普通 API Key 渠道均可切换三种格式,Gemini 原生与 Codex OAuth 保留专用链路。
  • 支持两种新协议的思考控制,以及 Messages 自适应/固定预算、最大输出 tokens。思考内容不进入正文,失败或截断不会被视为完整成功。
  • 配置按渠道保存,换预设重置格式覆盖,参数变更使旧测试结果失效;补齐 Host 存储映射、五种语言和浏览器交互。
  • 复用现有客户端和超时、取消机制,统一流式读取,覆盖跨块 UTF-8、CRLF 及取消后停止消费。

验证

  • cargo test --locked -p openless-core --quiet
  • npm.cmd run build
  • node scripts/frontend-test-runner.mjs
  • Tauri Host:新协议字段持久化/重新加载及凭据账户映射测试通过。
  • 浏览器:格式切换与重新打开回显、换预设重置、非法预算阻止验证、修正后恢复验证通过。
  • git diff --check upstream/beta...HEAD

未使用真实服务商凭据执行联网验证。Host 与浏览器检查在实现阶段完成;Core、前端构建和前端测试在移到最新 beta 后重新运行。

Closes #1039

#1023 留待后续接入本 PR 的通用能力;本 PR 不包含 OpenCode Zen 供应商专用改动。

@H-Chris233
H-Chris233 merged commit 2b7c9d1 into Open-Less:beta Sep 8, 2026
4 checks passed
H-Chris233 added a commit that referenced this pull request Sep 8, 2026
#1023)

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

Dictation polish uses OpenAI-compatible chat/completions. For OpenCode Go, change the Base URL to /zen/go/v1.

* fix(macos): 避免 Fn 长按与功能键误触发听写 (#1008)

Auto 和 Toggle 模式只在 Fn 短按松开且未叠加功能层操作时触发听写;长按及亮度、音量等 systemDefined 事件留给 macOS。

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

Co-authored-by: Chris233 <h-chris233@outlook.com>

* fix(asr): 百炼 WebSocket 优先走 IPv4,避开本机 IPv6 黑洞 (#1036)

* 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>

* fix(updater): Beta 构建默认跟随 Beta 渠道 (#1041)

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

* fix(updater): persist channel switches atomically

* feat(llm): 支持渠道级 Chat Completions、Responses 和 Messages (#1042)

* feat(llm): add channel request formats and compatibility presets

* fix(llm): harden channel protocol handling

* feat(llm): integrate OpenCode Zen with shared request formats

---------

Co-authored-by: Mark <shawninjuly@gmail.com>
Co-authored-by: Chris233 <h-chris233@outlook.com>
Co-authored-by: 浩彬(^-^) <146098469+HKLHaoBin@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

添加自定义Responses和Messages请求格式

1 participant