mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 01:45:56 +03:00
[PR #231] [CLOSED] fix(kiro): 优化 401 错误处理逻辑并修复健康检查错误 #311
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#311
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?
📋 Pull Request Information
Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/231
Author: @leonaii
Created: 1/14/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (6)
901b5ecfix(i18n): 添加 credentialSwitchMaxRetries 配置项的中英文翻译499b974Merge branch 'main' of https://github.com/leonaii/AIClient-2-API6e65ba3fix(kiro): 增强401错误处理并支持Gemini格式请求体转换,修复健康KIRO健康检查错误。5a93f59Merge branch 'justlovemaki:main' into main36d45dfMerge branch 'main' of https://github.com/leonaii/AIClient-2-APIf52e4b5fix(kiro): 添加token刷新单例锁并增强JSON解析容错📊 Changes
3 files changed (+220 additions, -27 deletions)
View changed files
📝
src/providers/claude/claude-kiro.js(+169 -17)📝
src/providers/provider-pool-manager.js(+47 -10)📝
static/app/i18n.js(+4 -0)📄 Description
Pull Request: fix(kiro): 优化 401 错误处理逻辑并修复健康检查错误
📋 概述
优化 Kiro API 的 401 错误处理逻辑,在尝试刷新 token 前先刷新 UUID,并修复健康检查时的
Cannot read properties of undefined (reading 'length')错误。🐛 问题描述
contents格式作为备用请求,但 Kiro 只支持messages格式,导致Cannot read properties of undefined (reading 'length')错误✨ 变更内容
src/providers/provider-pool-manager.jsrefreshProviderUuid方法,移除 Kiro 的contents格式备用请求src/providers/claude/claude-kiro.js_refreshUuid方法,修改 401 处理逻辑,添加contents格式支持🔧 技术细节
1. ProviderPoolManager - 新增
refreshProviderUuid方法2. ProviderPoolManager - 修复健康检查请求格式
修改前:
修改后:
3. claude-kiro.js - 401 处理逻辑优化
修改前:
修改后:
4. claude-kiro.js - 添加
contents格式支持(防御性修改)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.