Repository navigation
fix(web): scope CC Switch models to the selected API key - #589
Merged
Merged
Conversation
Fetch the selected credential’s relay catalogue, isolate short-lived selectors, and block exports during loading or failed authorization. Cover DOM isolation and the real TokenAuth group, model-limit, pricing and expiry boundaries. Refs #380.
…h-models-20261003
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
9 tasks done
This was referenced Oct 3, 2026
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.
LMM API Pull Request
变更说明 / Summary
CCSwitch 原来使用账号模型目录,可能向只允许
allowed-model的 Key 提供denied-model。改为携带当前 Key 查询本实例/v1/models,直接继承真实 TokenAuth 的普通/Auto 分组、模型限制、价格可见性、过期及停用规则。换 Key、关闭或重新打开时重建选择与短期缓存;加载、刷新、错误及失效时阻止导出,点击时再次检查查询状态。模型查询固定使用本实例地址,禁止重定向,不携带 console cookie。请求限 15 秒,响应限 1 MiB/10,000 个模型/512 字符 ID;缓存仅保留模型 ID 和固定错误。Key 不进入查询键、持久化存储或错误内容。余额授权沿用现有独立操作。
与上游的关系 / Upstream relationship
上游参考 / Upstream reference: N/A。修复本仓库 CCSwitch 与 relay 授权目录不一致的问题;保留现有来源、版权及许可证信息。
关联 Issue / Related issue
Refs #380。这里只解决 CCSwitch 模型目录这一处问题;新用户接入、运营分析及真实客户端/数据库/部署验收的剩余项继续由该 issue 跟踪。
变更类型 / Type of change
验证 / Verification
原始修复提交
fbc74da956dbfc8176e8d2b8c3690fc1d029e599。首次整合 head
efdc1d52d7242ee6bff5e77b8dcc74a2b3ff0c0f无冲突正常 merge main565c99e5b;12 项直接 Web 回归、全 app typecheck、变更文件 lint/format、真实 router regular 再次通过。相关源码未变,race/vet 沿用下述原始源结果。最终 immutable head
3d2497c79a70b2f2ac6e1dee45ed056343cd9e27正常 merge #591 的 WS 失败限额释放修复;原六个 CCSwitch 文件 byte-identical,新增仅两个 WS 文件。完整 relay race/vet 再次通过。旧服务器验收唯一失败已确认为 main 既有 WS 竞态;此 head 的 CI、完整服务器资格、CodeQL 和 browser-review 均已通过,无失败或待执行项。依赖 #591 已合入。截图或日志 / Screenshots or logs
回归使用原生组件 DOM 与真实 TokenAuth router;测试直接断言可见模型、Authorization 隔离、余额状态及缓存中不包含凭据。敏感值均为测试占位符。
提交检查 / Checklist