mirror of
https://github.com/BenedictKing/kiro.rs.git
synced 2026-04-25 06:55:50 +03:00
[PR #72] fix(converter): 静默丢弃 assistant prefill 而非返回错误 #40
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/kiro.rs#40
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?
Original Pull Request: https://github.com/hank9999/kiro.rs/pull/72
State: closed
Merged: Yes
问题
部分客户端(如旧版 Claude Code)会在消息末尾附加 assistant prefill 消息。Claude 4.x 已弃用此特性,Kiro API 也不支持,导致请求失败。
修复
在
convert_request中检测末尾 assistant 消息,静默截断到最后一条 user 消息。修改build_history签名接受 messages 切片,确保历史构建也使用截断后的消息列表。改动范围
src/anthropic/converter.rs:convert_request添加 prefill 预处理,build_history签名调整