Skip to content

fix: universal Custom routing and scheduler rejection diagnostics - #17

Merged
WilliamWang1721 merged 88 commits into
mainfrom
fix/universal-router-diagnostics-phase1
Jul 10, 2026
Merged

WilliamWang1721 merged 88 commits into
mainfrom
fix/universal-router-diagnostics-phase1

Conversation

@WilliamWang1721

@WilliamWang1721 WilliamWang1721 commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

第一阶段修复

路由修复

  • 兼容历史 Custom 账号把协议写入 credentials.protocol 的数据,并增加迁移统一到 extra.protocol
  • 普通消息请求由 Protocol Router 判断账号协议是否可转换;不再让 Custom 账号因旧协议字段而在调度前消失
  • Router 模式继续支持跨协议转换;Passthrough / Full Passthrough 仍严格要求同协议

错误分析面板

  • 后端在请求发生时记录每个账号经过的调度阶段和首个拒绝原因
  • 覆盖协议、启用状态、手动调度开关、过期、过载、限流、临时停用、额度、隐私要求、模型白名单、渠道限制、模型限流、滚动费用、RPM、会话限制等条件
  • 面板优先展示“请求时记录”,无法取得历史记录时才显示“当前状态推断”
  • 同时展示入站协议、评估账号数量和各拒绝原因统计
  • 逐账号诊断只写入 Ops 运维错误上下文;下游客户端仅收到不含账号 ID、账号名称和内部状态的安全概括信息

测试

已通过:

  • go test ./internal/service ./internal/handler
  • 前端 pnpm 9 依赖安装与 pnpm typecheck
  • 前端完整 make test-frontend(类型检查及关键 Vitest)
  • 新增历史 Custom 协议兼容测试
  • 新增 Full Passthrough 协议拒绝诊断与“诊断不泄漏到客户端”测试

全仓 make test-unit 与 golangci-lint 仍存在主分支已有问题,失败位置均不属于本 PR 新增文件:API contract 快照未同步、TokenRefreshService 旧测试参数、若干历史 errcheck/gofmt/unused 问题。本 PR 未顺带扩大范围修改这些无关问题。

@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, we need you all to sign our Contributor License Agreement (CLA).

To sign, please reply with the following comment:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once — it will be valid for all your future contributions to this project.


I have read the CLA Document and I hereby sign the CLA


0 out of 2 committers have signed the CLA.
❌ @WilliamWang1721
❌ @openai-ci-fixer
openai-ci-fixer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

github-actions Bot and others added 26 commits July 10, 2026 05:57
WilliamWang1721 and others added 27 commits July 10, 2026 16:37
@WilliamWang1721
WilliamWang1721 marked this pull request as ready for review July 10, 2026 10:24
@WilliamWang1721
WilliamWang1721 merged commit 192539b into main Jul 10, 2026
3 of 12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant