feat(providers): add provider usage queries#270
Merged
su-fen merged 18 commits intoJul 26, 2026
Conversation
解决与 main 的冲突(模型排序快照重构 × onTestUsage 注入),从合并后的 gateway.proto 用 buf 1.71.0 重新生成 gateway.pb.go 与 gateway_pb.ts (buf lint 与对 main 的 breaking 检查通过);同时移除分支上的 docs/superpowers 过程规划文档。
将 usageQuery 的状态归约/协调器/hook 逻辑抽入 usageQueryCore.ts, 按镜像纪律加入 mirror-manifest 逐字节强制;两端 usageQuery.ts 只保留 平台传输适配(GUI 走 Tauri invoke,WebUI 走 Gateway WebSocket 桥接)。 providerUtils.ts 两端本已逐字节一致,一并入 manifest 防漂移。
Member
|
维护者推送了两个提交,解决合入前的阻塞项: 2c8e08e — Merge main 解冲突 + proto 重生成 + 移除过程文档
3ec4725 — 镜像纪律
验证(本机 darwin):GUI 前端 1301/1301、WebUI 462/462、Go 剩余关注点:等 CI 验证 Windows/Linux 交叉构建( |
用量查询表单 6 个输入框(script/baseUrl/accessToken/userId/ accessKeyId/secretAccessKey)在 setState 更新器回调体内读 event.currentTarget.value;React 派发结束后 currentTarget 置 null, dev StrictMode 双调用更新器时第二次执行即崩(输入即报错)。 改为先同步取值存局部变量再入更新器,与同文件 autoRefreshMinutes 及模型编辑处的既有修复范式一致;两端同改。
…feedback 1. 移除"允许本地网络地址"开关:本地/私网与公网地址、http 与 https 默认均可查询(仍拒绝 URL 内嵌凭据与非 HTTP 协议,标准模板仍限 Base URL 同源,内置适配器仍限 HTTPS);出网统一走应用代理配置 (system_proxy async builder,显式 no_proxy 语义,代理未启用即直连, 配置无效 fail fast),原 DNS 钉扎/私网地址过滤随门控一并移除。 2. 自动刷新固定 5 分钟:usageQueryCore 常量化 AUTO_REFRESH_INTERVAL_MS, 移除 autoRefreshMinutes 配置字段(schema/规范化/默认值/UI 同步清理, 旧配置多余字段由 serde/normalize 静默忽略)。 3. 测试查询内联反馈:模态框内新增 running/success/error 状态面板, 展示条目、错误与空数据提示;测试实刷后卡片改走 hydrateProvider 缓存补水,不再重复请求上游;按钮查询期间禁用并旋转图标。 两端(GUI/WebUI)同步修改;i18n 删除旧开关与刷新间隔文案,新增测试 反馈文案。
查询方式移除"余额适配器":Rust 删除 balance 模式分支与 DeepSeek/StepFun/SiliconFlow/OpenRouter/Novita 六家适配器及其 提取器与测试;保留自定义脚本、通用模板、NewAPI、Coding Plan 四项。 默认查询方式改为自定义脚本;历史配置中的 "balance" 与未知值在 规范化时统一回退 custom(桌面端存量 JSON 未重写前由 Rust 的 Unsupported mode 错误兜底)。两端下拉选项按 自定义/通用/NewAPI/ Coding Plan 重排,i18n 删除余额适配器文案。
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.
功能
安全
usageQuery.accessToken、usageQuery.secretAccessKey和 secret side-channel 做递归脱敏/隔离usageQuery时保持兼容,不阻断供应商配置加载测试
pnpm -C crates/agent-gui test:frontend:1238/1238 passedpnpm -C crates/agent-gateway/web test:419/419 passedpnpm -C crates/agent-gui buildpnpm -C crates/agent-gateway/web buildpnpm -C crates/agent-gui lint、pnpm -C crates/agent-gateway/web lint:通过,保留现有 warningnode scripts/check-mirror.mjs:104 files passedcargo fmt --manifest-path crates/agent-gui/src-tauri/Cargo.toml --checkgit diff --checkTcpListener::bind限制make proto-check未运行:本机缺少bufrquickjs-sys与跨平台打包交由 CI 验证