diff --git a/internal/lua/plugins/channels.lua b/internal/lua/plugins/channels.lua index a590ce5..2490dad 100644 --- a/internal/lua/plugins/channels.lua +++ b/internal/lua/plugins/channels.lua @@ -123,7 +123,9 @@ local PLATFORMS = { }, }, hosts = { "www.trae.cn", "api.trae.com.cn", "api.trae.cn", "trae-api-cn.mchost.guru" }, - base_url = "https://trae-api-cn.mchost.guru", + -- trae 非 OpenAI 兼容:端点是 SOLO 的 /api/agent/v3/llm_utils_chat, +-- 载荷须转 config_name/function 格式(见 trae-adapter.ts:374)。 + base_url = "https://trae-api-cn.mchost.guru/api/agent/v3/llm_utils_chat", adapter = "openai", -- 照参考 TRAE_FALLBACK_MODELS 全量(32 项)。其中 4 项带 isHidden -- (内部子 agent)—— 不进用户可选列表,单列在 models_hidden。 @@ -275,7 +277,8 @@ local PLATFORMS = { body = '{"accessToken":"{access_token}","refreshToken":"{refresh_token}"}', }, hosts = { "api.workos.com", "api.cline.bot", "app.cline.bot" }, - base_url = "https://api.cline.bot", + -- cline 的 chat 路径是 /api/v1/chat/completions(参考 CLINE_CHAT_PATH)。 + base_url = "https://api.cline.bot/api/v1/chat/completions", -- 远端模型目录(照参考 cline-models.ts:**必须同时打两个端点**)。 -- 关键:/api/v1/models 的 460 个 id 里**没有** cline-free/*,免费模型只由 -- recommended-models 下发;只打前者会看不到任何免费模型。 @@ -331,7 +334,8 @@ local PLATFORMS = { interval = 1, }, hosts = { "copilot.tencent.com", "www.codebuddy.cn" }, - base_url = "https://copilot.tencent.com", + -- buddy 的 chat 端点含 /v2 前缀(参考 CHAT_API_BASE = .../v2 + /chat/completions)。 + base_url = "https://copilot.tencent.com/v2/chat/completions", -- 远端模型目录(照参考 buddy.ts CONFIG_PATH + buddy-oauth.ts fetchModels)。 -- 关键:必须带 product 身份头,否则 WorkBuddy 会以 CodeBuddy 身份请求。 models_remote = { @@ -540,7 +544,8 @@ local PLATFORMS = { path = "data.value.version", fallback = "2026.9.4", }, - base_url = "https://lobsterai-server.youdao.com", + -- lobsterai 的 chat 路径是 /api/proxy/v1/chat/completions(参考 LOBSTERAI_CHAT_PATH)。 + base_url = "https://lobsterai-server.youdao.com/api/proxy/v1/chat/completions", -- 远端模型目录(照参考 lobsterai.ts LOBSTERAI_MODELS_PATH) models_remote = { -- 参考真值 LOBSTERAI_API_BASE(lobsterai-server.youdao.com)。 @@ -578,7 +583,8 @@ local PLATFORMS = { name = "OpenCode Zen", vendor = "opencode", flow = "paste", - base_url = "https://opencode.ai/zen", + -- opencode 的 chat 路径是 /v1/chat/completions(参考 chatPath)。 + base_url = "https://opencode.ai/zen/v1/chat/completions", -- 远端模型目录(照参考 opencode-product.ts modelsPath) models_remote = { endpoints = { { url = "https://opencode.ai/v1/models", method = "GET" } }, @@ -622,7 +628,8 @@ local PLATFORMS = { hosts = { "codearts.huaweicloud.com", "sts.cn-north-4.myhuaweicloud.com", "snap-access.cn-north-4.myhuaweicloud.com", "devcloud.cn-north-4.huaweicloud.com", "auth.huaweicloud.com" }, - base_url = "https://snap-access.cn-north-4.myhuaweicloud.com", + -- codearts 的 chat 端点含 /api/v2 前缀(参考 CHAT_API_BASE = .../api/v2)。 + base_url = "https://snap-access.cn-north-4.myhuaweicloud.com/api/v2/chat/completions", adapter = "openai", models = { "CodeArts-Pangu" }, checkin = { @@ -666,7 +673,8 @@ local PLATFORMS = { judge = "pending404", interval = 2, }, - base_url = "https://api2-v2.qoder.sh", + -- qoder 的 chat 路径是 /model/v1/chat/completions(参考 QODER_CHAT_PATH)。 + base_url = "https://api2-v2.qoder.sh/model/v1/chat/completions", adapter = "openai", -- 兜底目录(照参考 QODER_FALLBACK_MODELS 的真实目录 key)。 -- 关键:这些是**上游目录 key**(如 qfmodel),不是通用名 —— 公开的 @@ -810,7 +818,9 @@ local PLATFORMS = { access_key_secret = "zsak6eadrbawz683wf5r3m2snrwj868r", app_id = "GM3LOOMY", }, - base_url = "https://loomy.xunfei.cn", + -- loomy 的 chat 路径是 {apiBase}/chat/completions(参考 loomy-adapter.ts:494 + -- 实测标准 OpenAI 兼容)。 + base_url = "https://loomy.xunfei.cn/chat/completions", adapter = "openai", -- 兜底目录(照参考 LOOMY_FALLBACK_MODELS)。此前 "loomy-default" 是我编的。 models = { @@ -844,7 +854,8 @@ local PLATFORMS = { interval = 2, }, -- 推理是标准 OpenAI 兼容(实测 POST /api/web/llm/v2/chat/completions) - base_url = "https://xiaohuanxiong.com/api/web/llm/v2", + -- raccoon 的 chat 端点是 /api/web/llm/v2/chat/completions。 + base_url = "https://xiaohuanxiong.com/api/web/llm/v2/chat/completions", adapter = "openai", -- 兜底目录(照参考 RACCOON_FALLBACK_MODELS)。此前 "raccoon-default" 是我编的。 -- 注意 sn- 前缀是本平台的真实命名约定(sensenova 系列)。