Repository navigation
feat(models): add models.hidden blacklist (list filtering + chat gating) - #225
Merged
linguo2625469 merged 1 commit intoOct 21, 2026
Merged
Conversation
Closed
jin66god
pushed a commit
to jin66god/workbuddy2api-panel
that referenced
this pull request
Oct 19, 2026
…inguo2625469#225/linguo2625469#221/linguo2625469#212/linguo2625469#158 + 面板配置入口与 README 重构) - linguo2625469#223 出站 Transport 读取 HTTP(S)_PROXY 环境变量 - linguo2625469#220 新增 cn.chat_base,修复海外出口 CN 模型全部缺失;models 拉取失败记 WARN - linguo2625469#225 models.hidden 模型黑名单:列表过滤 + 点名 400,热生效 - linguo2625469#221 11158 区分账号类型无权限;模型锁按 realm 隔离;全池无权限返回 400 - linguo2625469#212 到期提醒快照与「检查」同口径:按日聚合批次、DeductionEndTime 优先 - linguo2625469#158 按地区独立调度:加权随机 / 轮询 / 顺序耗尽 + 账号顺序,热生效 - 面板「上游与高级」补 CN 上游地址与模型黑名单入口(含前端回归测试) - README 精简重构:能力/配置/部署以本仓库为准,删除开发向流水账 - 新增 GitHub Issue 模板:Bug / 功能 / 其他
jin66god
added a commit
to jin66god/workbuddy2api-panel
that referenced
this pull request
Oct 19, 2026
…inguo2625469#225/linguo2625469#221/linguo2625469#212/linguo2625469#158 + 面板配置入口与 README 重构) - linguo2625469#223 出站 Transport 读取 HTTP(S)_PROXY 环境变量 - linguo2625469#220 新增 cn.chat_base,修复海外出口 CN 模型全部缺失;models 拉取失败记 WARN - linguo2625469#225 models.hidden 模型黑名单:列表过滤 + 点名 400,热生效 - linguo2625469#221 11158 区分账号类型无权限;模型锁按 realm 隔离;全池无权限返回 400 - linguo2625469#212 到期提醒快照与「检查」同口径:按日聚合批次、DeductionEndTime 优先 - linguo2625469#158 按地区独立调度:加权随机 / 轮询 / 顺序耗尽 + 账号顺序,热生效 - 面板「上游与高级」补 CN 上游地址与模型黑名单入口(含前端回归测试) - README 精简重构:能力/配置/部署以本仓库为准,删除开发向流水账 - 新增 GitHub Issue 模板:Bug / 功能 / 其他
shinny-xionghongwei
added a commit
to shinny-xionghongwei/workbuddy2api-panel
that referenced
this pull request
Oct 20, 2026
…ist filtering + chat gating)
maintell
added a commit
to maintell/workbuddy2api-panel
that referenced
this pull request
Oct 21, 2026
吸收的上游修复(均为 bug fix): - linguo2625469#233 国际版 11-128 通道校验分流 + 始终发送 X-Conversation-ID(取代本地 linguo2625469#190 旧实现;11-128 不再硬禁用账号) - linguo2625469#159 剥离 content 里的 reasoning_text 片段,修 Codex 转换后 11101 - linguo2625469#185 6021 queue.full 归为渠道级繁忙(不轮转、不罚号,503 upstream_busy) - linguo2625469#217 同账号 refresh 单飞,避免 RT 复用撞 12153 掉登录 - linguo2625469#162 识别企业切换会话 token_source=enterprise_switch - linguo2625469#199 缓存告警假阳性:miss 显式存在时对称反推 hit 另含 linguo2625469#138 linguo2625469#143 linguo2625469#144 linguo2625469#158 linguo2625469#178 linguo2625469#196 linguo2625469#205 linguo2625469#213 linguo2625469#220 linguo2625469#221 linguo2625469#223 linguo2625469#225 linguo2625469#230 linguo2625469#232 等功能更新。 本地改动:README 停维护声明改写为本 fork 口径;版本号 1.14.0-panel。
5 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
WorkBuddy 账号的模型目录里会列出一些 Pro 专属模型:它们能被
/v1/models查出来,但实际调用会被上游拒绝。下游(尤其是自动选模型的 agent)看到这些模型后去调,只能拿到上游报错,浪费一次请求、污染重试逻辑。网关侧需要一种"让某些模型彻底消失"的能力。改动
新增
models.hidden配置项示例:cn:和global:两域都藏;"cn:xxx"/"global:xxx"前缀 = 只藏该域(与resolveModel的[realm:]model协议对称,大小写敏感)GET /v1/models—— 列表里直接过滤掉,下游看不到POST /v1/chat/completions—— 点名硬调直接400 model_unavailable,不打上游、不占选号(只藏列表不够,知道名字仍可调)livecfg热生效,无需重启(与api_key/soft_rate同一机制)实现要点
internal/livecfg:Snapshot.HiddenModels+NormalizeHiddenModels()(配置→精确 id 集合的一次性归一化,查询侧零解析成本)internal/server:modelList()两处过滤(CN / global 分支,id 本来就带域前缀,直接查集合);chatCompletions在resolveModel之后拦截;loadLive()的 nil fallback 也覆盖(测试路径)cmd/server:Config.Models.Hidden+ 启动/热应用两处快照填充 +server.Config.ModelsHidden接线model_unavailable(与上游 11102 同一口径,客户端会换模型而不是重试)测试
TestNormalizeHiddenModels: 裸名展开两域、前缀精确、空白裁剪、非法前缀视为裸名、nil回nilTestChatHiddenModelRejected: 裸名/cn:/global:三种写法都 400,且上游零调用;global:精确隐藏不影响cn:同名;未隐藏模型照常放行TestModelsHiddenFiltered: 预置动态模型缓存,/v1/models不含隐藏模型go build ./.../go vet通过;全量go test仅TestModelsEndpoint失败(该用例依赖真实上游,在干净树上同样失败,非本 PR 引入)文档
config.example.json加示例 + 注释