feat(account): 新增账号测试功能,测试该账号的文字/图片模型是否可用,与凭证可用性测试 - #452
Open
agermel wants to merge 1 commit into
Open
Conversation
新增「测试账号」入口:对账号发一次真实上游请求,验证其使用文字/图片模型的凭据是否可用,通过 SSE / Tauri 事件把进度与结果实时回传到弹窗。 - 图片测试走 image_generation 工具(顶层文字模型 + gpt-image-2 工具),而不是把 gpt-image-2 当顶层主模型直连——后者会被上游以「ChatGPT 账号 不支持该模型」拒绝。 - 依据所选模型的能力(supports_image_generation)自动修正测试类型,并把kind 字段端到端打通(修复 Tauri 命令静默丢弃 kind 的问题)。 - 依据测试结果更新账号状态:401/403 → 不可用,429 → 限流,成功 → 恢复active(手动 disabled/inactive 不自动恢复)。
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.
RT

变更摘要
改动范围
主要文件
crates/service/src/account/account_test.rs(新增)— 测试核心:发起请求、解析 SSE、状态回写、取消、脱敏crates/service/src/http/account_test_events.rs(新增)— 账号测试事件的 SSE 端点(tiny_http + axum 双实现)crates/service/src/account/account_status.rs— 测试结果 → 账号状态(unavailable / limited / restore active)crates/service/src/gateway/core/runtime_config.rs— 账号测试代理解析 + 带超时的上游客户端crates/service/src/models_v2/mod.rs—supports_image_generation()能力判定apps/src/components/modals/account-test-modal.tsx(新增)— 测试弹窗(分组下拉 + 实时终端 + 图片预览)apps/src/lib/api/account-test-events.ts(新增)— Tauri / SSE 事件监听apps/src/components/ui/select.tsx— 下拉锚定默认alignItemWithTrigger=false验证
pnpm -C apps run testpnpm -C apps run buildpnpm -C apps run test:uicargo test --workspace已执行的实际验证:
未执行的验证与原因:
风险与影响面
备注