Commit Graph

4 Commits

Author SHA1 Message Date
谢栋梁
ce7df12281 fix: 识别 403 permission_error 为账号封禁状态,避免 30 分钟无限循环
Claude 封禁账号后返回 HTTP 403 + permission_error:
"OAuth authentication is currently not allowed for this organization."

原有的 _isOrganizationDisabledError 只检测 HTTP 400,无法识别该错误。
且 else if 分支中通用 403 在 organizationDisabledError 之前,
即使修改函数也会被截断。

修复内容:
1. _isOrganizationDisabledError 兼容 403 + permission_error 场景
2. 非流式路径:将 organizationDisabledError 检测提前到通用 403 之前
3. 流式路径:在 403 分支内部优先判断是否为封禁性质的 403

Closes #990
2026-02-18 18:09:49 +08:00
Lukin
feb8d3974d fix: patch orphaned tool_use blocks missing tool_result in Claude relay
Clients (e.g. opencode) may truncate conversation history in long sessions, leaving tool_use blocks without corresponding tool_result. The upstream Claude API strictly validates this pairing and returns 400. This adds _patchOrphanedToolUse() to claudeRelayService._processRequestBody(), which detects orphaned tool_use IDs and synthesizes error tool_result blocks — the same approach already used in anthropicGeminiBridgeService for the Antigravity path.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-13 11:41:39 +08:00
shaw
0cdfd65142 Merge branch 'main' into feat/oai_optimize 2026-02-10 19:09:59 +08:00
SunSeekerX
a119cb1744 1 2026-02-09 18:13:45 +08:00