mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 09:55:54 +03:00
[PR #203] [CLOSED] feat(kiro): Add extended thinking support and enhanced token estimation #301
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#301
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/203
Author: @tickernelz
Created: 1/9/2026
Status: ❌ Closed
Base:
main← Head:feat/kiro-thinking-support-v2📝 Commits (7)
fe38820Merge branch 'justlovemaki:main' into main1aa0f37Merge remote-tracking branch 'aiclient/main'fc01608Revert "refactor(kiro): 优化流式响应立即发送message_start,移除contextUsagePercentage等待逻辑"2d4690fMerge branch 'fix-400-kiro'c53e38ffeat(kiro): add extended thinking support with streaming content block handlingb6fb472refactor(kiro): improve input token estimation with detailed breakdown and dynamic updates692fa49Merge remote-tracking branch 'aiclient/main' into feat/kiro-thinking-support-v2📊 Changes
1 file changed (+441 additions, -78 deletions)
View changed files
📝
src/claude/claude-kiro.js(+441 -78)📄 Description
Summary
This PR implements extended thinking support for Claude's Kiro API adapter and significantly improves input token estimation accuracy for better context management in AI agent tools.
Key Features
1. Extended Thinking Support
2. Enhanced Token Estimation
3. Performance Characteristics
Testing
Extensively tested across multiple AI agent tools:
All tools demonstrate improved context management and accurate token estimation across various workload patterns including:
Technical Implementation
Thinking Support
KIRO_THINKINGconstants for tag managementbuildCodewhispererRequest()to inject thinking prefixes and handle thinking blocksgenerateContentStream()with proper state machine for real-time parsingbuildClaudeResponse()for non-streaming thinking supportToken Estimation
estimateInputTokens()to iterate through all content typesFiles Changed
src/claude/claude-kiro.js: +441 lines, -78 linesBreaking Changes
None. All changes are backward compatible.
Related Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.