refactor(endpoints): 精简为国内与海外两条线路#33
Conversation
移除 qiniu 与 sufy 线路,默认线路改回 china,海外线路统一使用 api.modelink.ai。
There was a problem hiding this comment.
Code Review
本拉取请求(PR)主要对 API 线路进行了清理和整合。具体修改包括:删除了已废弃的 qiniu (openai.qiniu.com) 和 sufy (openai.sufy.com) 线路;将默认线路(DEFAULT_ENDPOINT)变更为 china (api.qnaigc.com);将 international 线路的地址更新为 api.modelink.ai。同时,PR 同步更新了 CLAUDE.md 文档、中英文语言包(zh_CN.json 和 en_US.json)以及相关的测试用例(tests/hermes-tool.test.mjs)。受影响的模块包括端点配置、国际化语言包、文档和测试。该改动在配置、本地化和测试中保持了一致性,可以安全合并。置信度评分为 5/5。目前没有发现任何问题,无进一步反馈。
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Review findings:
README.md:30,README.md:211: The user-facing README still documents the removedopenai.qiniu.com,openai.sufy.com, and separate Modelink routes, and its examples still show the old default endpoint. After this PR, new users reading the published README will see a four-route setup that the CLI no longer offers. Please update the README endpoint list and sample generated configs to match the two supported routes.
Findings without inline locations
src/lib/endpoints.ts:28: Existing users can already haveendpoint: modelinkin~/.coding-helper/config.yamlfrom the previous release. Withmodelinkremoved fromENDPOINT_DEFINITIONS,getBaseUrl('modelink')now falls through toDEFAULT_ENDPOINT, which this PR changes to the China route. That silently moves those users fromhttps://api.modelink.aitohttps://api.qnaigc.comon the nextauth reload,doctor, or model fetch. Please add a compatibility mapping or migration so the oldmodelinkID resolves to the new international route instead of the default.
Codex 评审结论:需要关注 发现的问题
验证说明 已按要求读取 |
精简线路后,老用户 config.yaml 中残留的 modelink / qiniu id 会命中不到定义表而回退到默认国内线路,导致原 Modelink 海外 用户被静默切到 api.qnaigc.com。 - 新增 normalizeEndpointId 与旧 id 映射(modelink→international、 qiniu→china),getBaseUrl 与 getEndpoint 读取时规范化 - 渲染层经规范化后正确显示线路,不再显示"未设置" - 同步更新中英文 README 线路文案与工具配置示例 - 新增 endpoints 迁移测试覆盖旧 id 映射与未知 id 回退
Codex 评审结论:通过 发现的问题 未发现本 PR 引入的阻断性问题。 本次变更影响的主要路径是 API 线路定义、默认线路、旧线路 ID 兼容、线路选择向导、状态栏线路展示,以及 交互风险检查
交互脚本使用临时 测试/验证 已读取验证文件作为证据:
|
变更类型
类型:refactor
影响范围
模块:其他
变更描述
将 API 线路从 4 条精简为 2 条:国内
api.qnaigc.com、海外api.modelink.ai,并同步更新文案与测试。动机和背景
统一接入点配置,移除不再使用的
openai.qiniu.com与openai.sufy.com线路,降低用户选择成本。具体改动
qiniu、modelink独立线路及原international(sufy)配置china(国内)与international(海外,指向api.modelink.ai)qiniu改回chinaCLAUDE.md及 Hermes 相关测试测试情况
pnpm build通过node --test tests/*.test.mjs全部 36 项测试通过