[PR #205] [MERGED] fix(kiro): 动态压缩 tools 解决 Claude Code 发送过多工具信息导致的 500 错误 #300

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

📋 Pull Request Information

Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/205
Author: @Done-0
Created: 1/10/2026
Status: Merged
Merged: 1/10/2026
Merged by: @justlovemaki

Base: mainHead: fix/kiro-tools-500-error


📝 Commits (2)

  • 250200b fix(kiro): 动态压缩 tools 解决 Claude Code 发送过多工具信息导致的 500 错误
  • ed45725 fix(provider-pool): 优化错误计数逻辑,避免并发请求导致误判 unhealthy

📊 Changes

2 files changed (+84 additions, -11 deletions)

View changed files

📝 src/providers/claude/claude-kiro.js (+71 -8)
📝 src/providers/provider-pool-manager.js (+13 -3)

📄 Description

问题:

  • Claude Code 发送过多工具信息,超出 Kiro API 请求限制导致 500 错误
  • 工具包括:内置工具、MCP 工具、Skills

解决方案:

  • 先尝试原始大小,超过 20KB 才进行压缩
  • 第一步:简化 input_schema,只保留 type/enum/required
  • 第二步:按比例缩短 description(最短 50 字符)
  • 保留全部工具和 skills 可调用,不丢弃任何工具

效果:

  • 80KB+ tools 压缩至 ~15KB

🔄 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/205 **Author:** [@Done-0](https://github.com/Done-0) **Created:** 1/10/2026 **Status:** ✅ Merged **Merged:** 1/10/2026 **Merged by:** [@justlovemaki](https://github.com/justlovemaki) **Base:** `main` ← **Head:** `fix/kiro-tools-500-error` --- ### 📝 Commits (2) - [`250200b`](https://github.com/justlovemaki/AIClient-2-API/commit/250200bd53c959a80efa07bf863486a27d797e70) fix(kiro): 动态压缩 tools 解决 Claude Code 发送过多工具信息导致的 500 错误 - [`ed45725`](https://github.com/justlovemaki/AIClient-2-API/commit/ed45725a6d4bf7d6dc38f08acac9922d7c50b290) fix(provider-pool): 优化错误计数逻辑,避免并发请求导致误判 unhealthy ### 📊 Changes **2 files changed** (+84 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/providers/claude/claude-kiro.js` (+71 -8) 📝 `src/providers/provider-pool-manager.js` (+13 -3) </details> ### 📄 Description 问题: - Claude Code 发送过多工具信息,超出 Kiro API 请求限制导致 500 错误 - 工具包括:内置工具、MCP 工具、Skills 解决方案: - 先尝试原始大小,超过 20KB 才进行压缩 - 第一步:简化 input_schema,只保留 type/enum/required - 第二步:按比例缩短 description(最短 50 字符) - 保留全部工具和 skills 可调用,不丢弃任何工具 效果: - 80KB+ tools 压缩至 ~15KB --- <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:52 +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#300
No description provided.