mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 09:55:54 +03:00
[GH-ISSUE #318] 哥你看看ai说的 #226
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tik30 on GitHub (Feb 11, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/318
我们在 2026-02-11 对 AIClient-2-API 做了源码和线上日志双重排查,结论是:
这是主项目的已存在 bug,不是 usage-management 插件导致。
问题点在 handleModelListRequest 的变量作用域:
common.js (line 790):toProvider 在 try 内定义。
common.js (line 815):catch 中使用 toProvider,当 try 前半段报错时会触发 ReferenceError: toProvider is not defined。
上游一致性证据
GitHub 仓库:justlovemaki/AIClient-2-API
main 与 tag v2.9.3.1 都指向同一 commit:7d414cd5ac62a2d51448e19517f1b489fe5923d8。
对比 common.js,v2.9.3.1..main 为 NO_DIFF,说明上游当前版本同样存在该代码路径问题。
可看位置:
https://github.com/justlovemaki/AIClient-2-API/blob/v2.9.3.1/src/utils/common.js#L790
https://github.com/justlovemaki/AIClient-2-API/blob/v2.9.3.1/src/utils/common.js#L815
线上日志证据(同一请求链路)
日志中同一请求 Req:bc6f4cf7 先出现原始错误(模型列表初始化失败),随后二次抛出:
Could not discover a valid Google Cloud Project ID(触发点在 common.js (line 797))
紧接着 Request failed (500): toProvider is not defined
栈顶定位 common.js:815:55)
为什么不是插件导致
插件只拦截 usage_ 前缀 key:
key-manager.js (line 13)
middleware.js (line 23)
非 usage_ key 请求会直接放行:
index.js (line 142)
因此该 500 与插件链路无直接因果关系。
@justlovemaki commented on GitHub (Feb 11, 2026):
toProvider is not defined ,toProvider 你看看是啥吧
Could not discover a valid Google Cloud Project ID,需要手动设置Project ID
如果你都不知道是啥,去看看文档