[GH-ISSUE #10] Input is too long #9

Closed
opened 2026-02-27 07:17:22 +03:00 by kerem · 2 comments
Owner

Originally created by @lonestike on GitHub (Dec 20, 2025).
Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/10

I encountered this issue today, still with Claude Code.
I don't find anything on your doc, have you ever encountered this one?

2025-12-20 22:18:16 | DEBUG    | kiro_gateway.http_client:_get_client:107 - Creating streaming HTTP client (read_timeout=300.0s)
2025-12-20 22:18:21 | ERROR    | kiro_gateway.routes:chat_completions:260 - Error from Kiro API: 400 - {"message":"Input is too long.","reason":"CONTENT_LENGTH_EXCEEDS_THRESHOLD"}
2025-12-20 22:18:21 | WARNING  | kiro_gateway.routes:chat_completions:274 - HTTP 400 - POST /v1/chat/completions - Input is too long. (reason: CONTENT_LENGTH_EXCEEDS_THRESHOLD)
2025-12-20 22:18:21 | DEBUG    | kiro_gateway.debug_logger:log_error_info:246 - [DebugLogger] Error info saved (status=400)

Originally created by @lonestike on GitHub (Dec 20, 2025). Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/10 I encountered this issue today, still with Claude Code. I don't find anything on your doc, have you ever encountered this one? ``` 2025-12-20 22:18:16 | DEBUG | kiro_gateway.http_client:_get_client:107 - Creating streaming HTTP client (read_timeout=300.0s) 2025-12-20 22:18:21 | ERROR | kiro_gateway.routes:chat_completions:260 - Error from Kiro API: 400 - {"message":"Input is too long.","reason":"CONTENT_LENGTH_EXCEEDS_THRESHOLD"} 2025-12-20 22:18:21 | WARNING | kiro_gateway.routes:chat_completions:274 - HTTP 400 - POST /v1/chat/completions - Input is too long. (reason: CONTENT_LENGTH_EXCEEDS_THRESHOLD) 2025-12-20 22:18:21 | DEBUG | kiro_gateway.debug_logger:log_error_info:246 - [DebugLogger] Error info saved (status=400) ```
kerem 2026-02-27 07:17:22 +03:00
Author
Owner

@jwadow commented on GitHub (Dec 21, 2025):

Hi, this is a common context overflow error in the LLM industry. Claude models only have a 200k token context window. This means the tool you're using my Kiro Gateway with can't effectively compress the context or even simply truncate some messages to get the request through.

Roughly speaking, you and the model wrote too much during the entire conversation. Ideally, you should separate each task into one chat. Or use other tools. It's strange that Claude Code can't work with context.

The only thing I could do is change the 400 error number to something else so that programs can handle it and display a clear error, but unfortunately, there's no standard error yet; it's usually a 400 error and that's it.

P.S. I've thought about it, and I might add a trimming function soon that can be optionally included in .env, but that's outside the scope of the "just kiro adapter".

<!-- gh-comment-id:3678279458 --> @jwadow commented on GitHub (Dec 21, 2025): Hi, this is a common context overflow error in the LLM industry. Claude models only have a 200k token context window. This means the tool you're using my Kiro Gateway with can't effectively compress the context or even simply truncate some messages to get the request through. Roughly speaking, you and the model wrote too much during the entire conversation. Ideally, you should separate each task into one chat. Or use other tools. It's strange that Claude Code can't work with context. The only thing I could do is change the 400 error number to something else so that programs can handle it and display a clear error, but unfortunately, there's no standard error yet; it's usually a 400 error and that's it. P.S. I've thought about it, and I might add a trimming function soon that can be optionally included in .env, but that's outside the scope of the "just kiro adapter".
Author
Owner

@oathzed commented on GitHub (Dec 31, 2025):

Hi, this is a common context overflow error in the LLM industry. Claude models only have a 200k token context window. This means the tool you're using my Kiro Gateway with can't effectively compress the context or even simply truncate some messages to get the request through.

Roughly speaking, you and the model wrote too much during the entire conversation. Ideally, you should separate each task into one chat. Or use other tools. It's strange that Claude Code can't work with context.

The only thing I could do is change the 400 error number to something else so that programs can handle it and display a clear error, but unfortunately, there's no standard error yet; it's usually a 400 error and that's it.

P.S. I've thought about it, and I might add a trimming function soon that can be optionally included in .env, but that's outside the scope of the "just kiro adapter".

Hi, jwadow, I think this is a big issue with kiro and your script. But what if we have an ai program that can handle its own context based on history? This seems to be the case with firebender, but as soon as I get this error with kiro all the ai progress is basically gone to shit cause I can no longer ask it to look back at what it's already done and continue. It'll give me the same error so I'm forced to open a new window and hope for the best that this time I don't reach the too long text error.

Also great job on this script it's incredible otherwise :).

<!-- gh-comment-id:3702494480 --> @oathzed commented on GitHub (Dec 31, 2025): > Hi, this is a common context overflow error in the LLM industry. Claude models only have a 200k token context window. This means the tool you're using my Kiro Gateway with can't effectively compress the context or even simply truncate some messages to get the request through. > > Roughly speaking, you and the model wrote too much during the entire conversation. Ideally, you should separate each task into one chat. Or use other tools. It's strange that Claude Code can't work with context. > > The only thing I could do is change the 400 error number to something else so that programs can handle it and display a clear error, but unfortunately, there's no standard error yet; it's usually a 400 error and that's it. > > P.S. I've thought about it, and I might add a trimming function soon that can be optionally included in .env, but that's outside the scope of the "just kiro adapter". Hi, jwadow, I think this is a big issue with kiro and your script. But what if we have an ai program that can handle its own context based on history? This seems to be the case with firebender, but as soon as I get this error with kiro all the ai progress is basically gone to shit cause I can no longer ask it to look back at what it's already done and continue. It'll give me the same error so I'm forced to open a new window and hope for the best that this time I don't reach the too long text error. Also great job on this script it's incredible otherwise :).
Sign in to join this conversation.
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/kiro-gateway-jwadow#9
No description provided.