[PR #198] [MERGED] refactor(kiro): 优化流式响应立即发送message_start,移除contextUsagePercentage等待逻辑 #297

Closed
opened 2026-02-27 07:18:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/198
Author: @leonaii
Created: 1/9/2026
Status: Merged
Merged: 1/9/2026
Merged by: @justlovemaki

Base: mainHead: main


📝 Commits (1)

  • e612a66 refactor(kiro): 优化流式响应立即发送message_start,移除contextUsagePercentage等待逻辑

📊 Changes

1 file changed (+30 additions, -54 deletions)

View changed files

📝 src/claude/claude-kiro.js (+30 -54)

📄 Description

  1. 立即发送message_start和content_block_start事件,不再等待contextUsagePercentage
  2. 使用estimateInputTokens预估输入token作为保底值
  3. 移除bufferedEvents缓冲机制和messageStartSent状态标记
  4. 简化content事件处理逻辑,直接yield而非条件判断
  5. 移除contextUsagePercentage未收到时的错误抛出逻辑
  6. 更新estimateInputTokens方法注释,标记为备用方案而非废弃

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/justlovemaki/AIClient-2-API/pull/198 **Author:** [@leonaii](https://github.com/leonaii) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 1/9/2026 **Merged by:** [@justlovemaki](https://github.com/justlovemaki) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`e612a66`](https://github.com/justlovemaki/AIClient-2-API/commit/e612a668320d054337fad109b378557b317da59d) refactor(kiro): 优化流式响应立即发送message_start,移除contextUsagePercentage等待逻辑 ### 📊 Changes **1 file changed** (+30 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `src/claude/claude-kiro.js` (+30 -54) </details> ### 📄 Description 1. 立即发送message_start和content_block_start事件,不再等待contextUsagePercentage 2. 使用estimateInputTokens预估输入token作为保底值 3. 移除bufferedEvents缓冲机制和messageStartSent状态标记 4. 简化content事件处理逻辑,直接yield而非条件判断 5. 移除contextUsagePercentage未收到时的错误抛出逻辑 6. 更新estimateInputTokens方法注释,标记为备用方案而非废弃 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 07:18:51 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#297
No description provided.