[GH-ISSUE #153] Claude Code: > /compact 压缩上下文会出现400异常:Kiro2API #123

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

Originally created by @MayDay-wpf on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/153

调试后可能的原因:Kiro对History长度有限制,建议进行自动裁剪

Originally created by @MayDay-wpf on GitHub (Jan 3, 2026). Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/153 调试后可能的原因:Kiro对History长度有限制,建议进行自动裁剪
kerem closed this issue 2026-02-27 07:18:06 +03:00
Author
Owner

@justlovemaki commented on GitHub (Jan 3, 2026):

#154 ,再试试

<!-- gh-comment-id:3707093929 --> @justlovemaki commented on GitHub (Jan 3, 2026): #154 ,再试试
Author
Owner

@MayDay-wpf commented on GitHub (Jan 3, 2026):

#154 ,再试试

感谢回复,但是这个不适用,因为上下文中没有图片,可能有用的日志信息:

[22:38:56] [ERROR] [Kiro] Error in streaming generation: {"message":"Request failed with status code 400","name":"AxiosError","stack":"AxiosError: Request failed with status code 400\n at settle (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/core/settle.js:19:12)\n at RedirectableRequest.handleResponse (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/adapters/http.js:547:9)\n at RedirectableRequest.emit (node:events:520:35)\n at RedirectableRequest._processResponse (D:\\GitHub\\AIClient-2-API\\node_modules\\follow-redirects\\index.js:409:10)\n at RedirectableRequest._onNativeResponse (D:\\GitHub\\AIClient-2-API\\node_modules\\follow-redirects\\index.js:102:12)\n at Object.onceWrapper (node:events:623:26)\n at ClientRequest.emit (node:events:508:28)\n at HTTPParser.parserOnIncomingClient (node:_http_client:780:27)\n at HTTPParser.parserOnHeadersComplete (node:_http_common:123:17)\n at TLSSocket.socketOnData (node:_http_client:615:22)\n at Axios.request (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async KiroApiService.streamApiReal (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1273:30)\n at async KiroApiService.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1392:30)\n at async KiroApiServiceAdapter.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/adapter.js:278:9)\n at async handleStreamRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:197:26)\n at async handleContentGenerationRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:440:9)\n at async handleAPIRequests (file:///D:/GitHub/AIClient-2-API/src/api-manager.js:52:13)\n at async Server.requestHandler (file:///D:/GitHub/AIClient-2-API/src/request-handler.js:203:32)"
[22:38:56] [ERROR] [Server] Error during stream processing: Error: Error processing response: Request failed with status code 400 at KiroApiService.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1528:19) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async KiroApiServiceAdapter.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/adapter.js:278:9) at async handleStreamRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:197:26) at async handleContentGenerationRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:440:9) at async handleAPIRequests (file:///D:/GitHub/AIClient-2-API/src/api-manager.js:52:13) at async Server.requestHandler (file:///D:/GitHub/AIClient-2-API/src/request-handler.js:203:32)

这次压缩的总字符数:50312 more characters,Kiro似乎有单次请求最大40K限制,可能还需要再加入请求token上限裁剪

<!-- gh-comment-id:3707099611 --> @MayDay-wpf commented on GitHub (Jan 3, 2026): > [#154](https://github.com/justlovemaki/AIClient-2-API/pull/154) ,再试试 感谢回复,但是这个不适用,因为上下文中没有图片,可能有用的日志信息: ``` [22:38:56] [ERROR] [Kiro] Error in streaming generation: {"message":"Request failed with status code 400","name":"AxiosError","stack":"AxiosError: Request failed with status code 400\n at settle (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/core/settle.js:19:12)\n at RedirectableRequest.handleResponse (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/adapters/http.js:547:9)\n at RedirectableRequest.emit (node:events:520:35)\n at RedirectableRequest._processResponse (D:\\GitHub\\AIClient-2-API\\node_modules\\follow-redirects\\index.js:409:10)\n at RedirectableRequest._onNativeResponse (D:\\GitHub\\AIClient-2-API\\node_modules\\follow-redirects\\index.js:102:12)\n at Object.onceWrapper (node:events:623:26)\n at ClientRequest.emit (node:events:508:28)\n at HTTPParser.parserOnIncomingClient (node:_http_client:780:27)\n at HTTPParser.parserOnHeadersComplete (node:_http_common:123:17)\n at TLSSocket.socketOnData (node:_http_client:615:22)\n at Axios.request (file:///D:/GitHub/AIClient-2-API/node_modules/axios/lib/core/Axios.js:45:41)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async KiroApiService.streamApiReal (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1273:30)\n at async KiroApiService.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1392:30)\n at async KiroApiServiceAdapter.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/adapter.js:278:9)\n at async handleStreamRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:197:26)\n at async handleContentGenerationRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:440:9)\n at async handleAPIRequests (file:///D:/GitHub/AIClient-2-API/src/api-manager.js:52:13)\n at async Server.requestHandler (file:///D:/GitHub/AIClient-2-API/src/request-handler.js:203:32)" ``` ``` [22:38:56] [ERROR] [Server] Error during stream processing: Error: Error processing response: Request failed with status code 400 at KiroApiService.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/claude/claude-kiro.js:1528:19) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async KiroApiServiceAdapter.generateContentStream (file:///D:/GitHub/AIClient-2-API/src/adapter.js:278:9) at async handleStreamRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:197:26) at async handleContentGenerationRequest (file:///D:/GitHub/AIClient-2-API/src/common.js:440:9) at async handleAPIRequests (file:///D:/GitHub/AIClient-2-API/src/api-manager.js:52:13) at async Server.requestHandler (file:///D:/GitHub/AIClient-2-API/src/request-handler.js:203:32) ``` 这次压缩的总字符数:50312 more characters,Kiro似乎有单次请求最大40K限制,可能还需要再加入请求token上限裁剪
Author
Owner

@justlovemaki commented on GitHub (Jan 4, 2026):

建议新建会话,会话不宜过长

<!-- gh-comment-id:3707823668 --> @justlovemaki commented on GitHub (Jan 4, 2026): 建议新建会话,会话不宜过长
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#123
No description provided.