Repository navigation
fix: 支持网关账号拉取、编辑与保存模型配置 - #1006
Merged
Merged
Conversation
ranxi2001
marked this pull request as ready for review
November 22, 2026 15:17
2 tasks done
2 tasks done
12 tasks done
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.
解决的问题与行为变化
platform=gateway/type=gateway的 New API 或 Sub2API 账号后,无法拉取该调用 Key 的/v1/models,创建/编辑缺少模型白名单和映射入口。credentials.model_mapping。关联记录与来源
production,固定源码基线c76d8d3de146408e35b79814955088b355c66135。fix/issue1003-gateway-model-sync-20261122,当前提交20c505945075488de6f0ab1b0b12ef719ae91a2d(F1 修复ff95a9cd7b27a88f9d07715d65ba2644aaafd321)(首版1f77c771286d814b91cde0db1ade9dcede0f0695)。父级已独立检查完整差异、静态 diffcheck、实时 production base 与贡献模板;首版独审 F1 已由新固定 head delta 独审关闭,源码 CLEAR;运行验收未完成。此 Draft 仅为可审查源码交付,不表示已通过 CI、截图或完整验收。管理员新功能提示
提示 ID:
NEW_FEATURE_NOTICES.gatewayModelSync = gateway-account-model-sync-20261122,登记于frontend/src/constants/newFeatureNotices.ts。所有展示位置:创建和编辑弹窗共用
GatewayModelSettings.vue;账号列表网关行的保存后拉取操作。关闭行为:三个入口共用一个 ID,沿用当前浏览器/管理员 localStorage 的共享隐藏与持久性,不承诺跨浏览器同步。
原有
crossPlatformGatewayAccountsID 不变;本 ID 公告此前缺失的网关模型配置入口,不重置旧功能提示。必要回归:
EditAccountModal.spec.ts新增真实 badge/store 的独立显示、兄弟标签联动、重建 store 后持久隐藏和测试用未来 C ID;尚未执行。实际三个页面入口及刷新/重新登录仍需远端浏览器验收。A 已关闭后 B 仍显示:已有定向测试源码,远端 CI 待运行。
点击 B 任一入口后同步隐藏:已有 badge/store 兄弟实例测试,实际三入口浏览器证据待补。
同一管理员刷新/重新登录后保持隐藏:已有 store 重建测试,真实浏览器待补。
C 新 ID 显示且 A/B 不复活:已有测试用 C ID,远端执行及截图待补。
复现与验收
https://relay.example.com、合成 Key、模型live/new/public和隔离 CI 数据库。没有连接生产或付费上游。public → live映射,保存。gateway_upstream_models_test.go、account_handler_gateway_models_test.go、gateway_account_management_test.go、gateway_messages_selection_test.go、account_repo_upstream_model_sync_integration_test.go;前端 Create/Edit/ModelWhitelistSelector/AccountsView 定向用例。均待远端执行。协议、调度或传输改动补充
GET /v1/models;无模型推理调用、无 stream。存储身份保持gateway/gateway,种类为new_api/sub2api。{"data":[{"id":"live"},{"id":"new"}]};账号配置:{"model_mapping":{"live":"live","public":"live"}}。实际验证
git diff --checkgit diff --cached --checkgit diff c76d8d3de146408e35b79814955088b355c66135 HEAD --checkgofmt -w.github/workflows/issue959-gateway-regression.yml.github/workflows/backend-ci.yml截图计划:复用 PR838 已审计的完整双源码树、真实 Vite/CSS 与隔离安装 harness,固定上述 base/head,增加两类 gateway 创建/编辑/保存后操作及提示交互;只使用合成数据。当前没有截图,不将对比 PNG 提交仓库。
兼容性与运行影响
upstream_kind/account_id。仅 gateway 草稿可由服务端解析保存 Key;其余调用仍要求非空 Key。普通 apikey/upstream/OAuth 的请求构造与元数据路径保留。文档与用户可见变化
创建/编辑可拉取并编辑网关账号模型;列表提供显式保存后拉取。复用现有中英文标签;真实 zh/en 渲染待验收。完整远端截图计划与验收矩阵保存在维护任务交接目录,当前不含截图或发布声明。
Agent 使用声明
turn_context,有效模型为gpt-6.1-sol,推理强度ultra。catalog_review:只读分析后端目录/路由/凭据与副作用边界;未写文件、未运行动态验证。模型/推理强度未独立核实,未知(主线程报告继承配置,但不作实测声明)。ui_harness_review:只读审查现有远端截图 harness;未写文件、未运行动态验证。模型/推理强度未独立核实,未知(同上)。gpt-6.1-sol/ultra。只读子审查frontend_review、backend_security_review、catalog_ci_review分别负责前端、后端安全和目录/CI;子线程有效模型/推理强度未知,未独立读取其 metadata。gpt-6.1-sol,推理强度不适用(接口未提供)。提交前自查
初版验收记录(20c505945)
网关模型界面验收(352cf901f)
远端 Chromium 使用完整应用、项目 CSS 和虚构 API 数据,基线为
c76d8d3de,候选为352cf901fb87c18e1fd229ed97299827445f8733。两种网关的模型发现与应用测试在基线上复现失败,在候选版通过。中英文浏览器验收覆盖创建、编辑、保存后重新打开、三个入口共享提示、刷新及模拟重新登录、窄屏深色模式。完整命令、执行步骤和截图见验收工作流。窄屏深色模式
维护补充由 Codex 完成,参与范围为验收脚本修复、日志核对与附件上传。精确模型 ID 和推理档位未提供。