mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-28 10:55:57 +03:00
[PR #93] [MERGED] fix: 修复 Kiro API currentMessage 必须为 userInputMessage 类型的问题 #257
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#257
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/93
Author: @MicoMiOvO
Created: 12/3/2025
Status: ✅ Merged
Merged: 12/3/2025
Merged by: @justlovemaki
Base:
main← Head:main📝 Commits (4)
826e6bafix: Kiro API currentMessage must be userInputMessage type26b5091fix: remove null/empty values from Kiro API requestc4a1d0afeat: implement real streaming for Kiro API using AWS Event Streamdcfa9e9perf: optimize stream parsing to avoid duplicates and improve efficiency📊 Changes
1 file changed (+331 additions, -73 deletions)
View changed files
📝
src/claude/claude-kiro.js(+331 -73)📄 Description
问题描述
当对话中最后一条消息来自
assistant角色时,buildCodewhispererRequest方法会错误地将assistantResponseMessage作为currentMessage构建请求。这会导致 Amazon CodeWhisperer API 返回 400 Bad Request 错误:
{ "message": "Improperly formed request.", "reason": null }## 根本原因
CodeWhisperer API 要求
currentMessage必须是userInputMessage类型。之前的实现在最后一条消息是 assistant 时,会将currentMessage设置为assistantResponseMessage,这不是有效的请求格式。解决方案
当最后一条消息来自
assistant角色时:history数组userInputMessage作为currentMessage这确保了
currentMessage始终是有效的userInputMessage类型,符合 API 的要求。修改内容
src/claude/claude-kiro.js中的buildCodewhispererRequest()方法currentMessage始终为userInputMessage类型测试
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.