From 4bdde9cd61ed7cb3018d5eaddab66b739987c6bd Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Tue, 13 Oct 2026 16:56:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(channels):=20=E9=80=90=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E5=8F=82=E8=80=83=E6=8F=92=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=9B=AE=E5=BD=95=EF=BC=88=E5=85=9C=E5=BA=95?= =?UTF-8?q?=E8=A1=A8=E5=85=A8=E9=87=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 照参考 *-product.ts 的 FALLBACK_MODELS 逐项补齐,此前每个平台都只挑了 几个"看着像"的 id,属偷工减料: - trae 7 → 28 可见 + 4 hidden(照 isHidden 语义单列 models_hidden, 不污染用户可选列表:browser_use_subagent / explore_sub_agent_v13 / explore_sub_agent_v2 / summary 都是内部子 agent) - lobsterai 3 → 19(远端 /api/models/available 须带 model_flag,否则少 kimi-k3 —— 参考注释点名) - opencode 3 → 14,并带 models_free(isFree 是官方语义:7 个 free 匿名可用) - qoder 17 → 19(补 CN 独有的 q37fmodel / gm51model,均 1M 上下文) - minimax 3 → 4(补 MiniMax-M2.7) model_list 相应支持 models_hidden(不进可选列表)与 models_free(isFree 字段) —— 此前 isFree 被硬编码为 false,把官方免费模型标成了付费。 对齐后与参考逐平台零差异(比对脚本结果):trae / minimax / cline / lobsterai / opencode / qoder / zcode / loomy / raccoon 全部一致。 --- internal/lua/plugins/channels.lua | 59 +++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/internal/lua/plugins/channels.lua b/internal/lua/plugins/channels.lua index df7fd84..a590ce5 100644 --- a/internal/lua/plugins/channels.lua +++ b/internal/lua/plugins/channels.lua @@ -125,9 +125,20 @@ 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", adapter = "openai", + -- 照参考 TRAE_FALLBACK_MODELS 全量(32 项)。其中 4 项带 isHidden + -- (内部子 agent)—— 不进用户可选列表,单列在 models_hidden。 models = { - "DeepSeek-V4-Flash", "DeepSeek-V4-Pro", "kimi-k3", "kimi-k2.6", - "glm-5", "glm-5.2", "Doubao-Seed-2.1-Pro", + "DeepSeek-V4-Flash-Official", "Doubao-Seed-2.1-Pro", "seed-code-pro-0430", + "Doubao-Seed-2.1-Turbo", "Doubao-Seed-2.0-Code", "glm-5.2", "glm-5-turbo", + "glm-5", "DeepSeek-V4-Pro", "DeepSeek-V4-Flash", "kimi-k3", "kimi-k2.7-code", + "kimi-k2.6", "minimax-m3", "qwen-3.7-plus", "sagitta", "aquila", + "custom_model_gemini", "custom_model_placeholder", "custom_model_1M_text", + "custom_model_1M", "custom_model_kimi", "custom_model_claude", + "custom_model_gpt-5", "custom_model_no-fc", "custom_model_deepseek_chat", + "custom_model_deepseek_reasoner", "custom_model_deepseek_v4", + }, + models_hidden = { + "browser_use_subagent", "explore_sub_agent_v13", "explore_sub_agent_v2", "summary", }, -- 每日签到:POST /trae/api/v2/ug/checkin_credits/claim body {} 到 UG 主机。 checkin = { @@ -206,7 +217,9 @@ local PLATFORMS = { parse = "id_list", }, adapter = "openai", - models = { "MiniMax-M3.1-Flash-Preview", "MiniMax-M3", "MiniMax-M2.7-highspeed" }, + -- 照参考 MINIMAX_FALLBACK_MODELS(4 项)。远端权威: + -- GET /mavis/api/v1/models?region=cn&buildEnv=prod + models = { "MiniMax-M3.1-Flash-Preview", "MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7" }, -- 每日签到(两步:状态预检 + 领取;幂等靠服务端状态) checkin = { url = "https://agent.minimax.cn/minimax-cloud/api/v1/signin/claim", @@ -537,7 +550,17 @@ local PLATFORMS = { parse = "id_list", }, adapter = "openai", - models = { "kimi-k3", "glm-5.2", "deepseek-v4-flash" }, + -- 照参考 LOBSTERAI_FALLBACK_MODELS 全量(19 项)。远端权威: + -- GET /api/models/available(**必须带 model_flag 参数**,否则只返回 25 个 + -- 且没有 kimi-k3 —— 参考注释点名)。 + models = { + "deepseek-v4-flash", "deepseek-v4-pro", "MiniMax-M3", "MiniMax-M2.7", + "qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", "qwen3.5-plus-2026-04-20", + "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6", "kimi-k2.5", + "doubao-seed-2-1-pro-260628", "doubao-seed-2-1-turbo-260628", + "doubao-seed-2-0-code-preview-260215", "glm-5.2", "glm-5.1", + "glm-5v-turbo", "glm-5", + }, -- 余额(对齐参考:GET /api/user/profile-summary) balance = { url = "https://lobsterai-server.youdao.com/api/user/profile-summary", @@ -563,7 +586,19 @@ local PLATFORMS = { parse = "id_list", }, adapter = "openai", - models = { "big-pickle", "claude-sonnet-4-20250514", "gpt-5.1-codex-mini" }, + -- 照参考 OPENCODE_FALLBACK_MODELS 全量(14 项)。isFree 是**官方语义 + -- 字段**(匿名可用与否):7 个 free 无需 key,其余需付费 key(实测匿名 401)。 + models = { + "big-pickle", "space-bunny-free", "longcat-2.5-preview-free", + "mimo-v2.6-flash-free", "mimo-v2.5-free", "nemotron-3-ultra-free", + "nemotron-3.5-lightning-free", "deepseek-v4-flash", "deepseek-v4.1-flash", + "glm-5.2", "kimi-k2.5", "minimax-m2.7", "minimax-m3", "qwen3.8-max", + }, + models_free = { + "big-pickle", "space-bunny-free", "longcat-2.5-preview-free", + "mimo-v2.6-flash-free", "mimo-v2.5-free", "nemotron-3-ultra-free", + "nemotron-3.5-lightning-free", + }, }, -- CodeArts(华为)—— 凭据 + SDK-HMAC-SHA256 签到(照参考 codearts-credits.ts)。 @@ -643,6 +678,9 @@ local PLATFORMS = { "qmodel_38max", "qfmodel", "qmodel_latest", "qmodel", "kmodel_latest", "kmodel", "gmodel", "gfmodel", "dmodel", "dfmodel", "mmodel", + -- CN 独有(参考注释点名:`q37fmodel` / `gm51model` 仅国区下发, + -- 两者都是 1M 上下文、支持图像与思考) + "q37fmodel", "gm51model", }, -- 余额(对齐参考 qoder-credits.ts:GET /sash/api/v2/me/usage,余额=userQuota.remaining -- + addOnQuota.remaining,走 openApiBase) @@ -5149,9 +5187,18 @@ function plugin.model_list(req) local plat = platformById(args and args.platform) if not plat then return { status = 400, json = { error = "未知平台" } } end local disabled = disabledModelsOf(plat.id) + -- models_hidden:内部子 agent(照参考 isHidden 语义)不进用户可选列表。 + local hidden = {} + for _, m in ipairs(plat.models_hidden or {}) do hidden[m] = true end + -- models_free:参考的 isFree 字段(官方语义:匿名/免费可用)。 + local free = {} + for _, m in ipairs(plat.models_free or {}) do free[m] = true end local out = {} for i, m in ipairs(effectiveModels(plat.id)) do - out[#out+1] = { id = m, name = m, disabled = disabled[m] and true or false, isFree = false } + if not hidden[m] then + out[#out+1] = { id = m, name = m, disabled = disabled[m] and true or false, + isFree = free[m] and true or false } + end end local remote = plugin.state.remoteModels and plugin.state.remoteModels[plat.id] return { status = 200, json = {