amazon-q-developer-cli
amazon-q-developer-cli copied to clipboard
Gracefully handle context window validation errors by summarizing chat history
Description
Currently, when a context window validation error occurs, chat requests fails without providing clear feedback to the user. This creates a confusing experience when users attempt to process files or inputs that exceed the maximum allowed context window size.
Problem
When a user's conversation context (files, messages, tool responses) exceeds the maximum context window size, the CLI throws an error and does not provide actionable error messages
Proposed Solution
Implement graceful handling of context window validation errors by:
- Handling validation exceptions sent from server
- Summarizing the existing chat context using an LLM call
- Allowing the session to continue rather than terminating
NOTE: we will need to remove server-side workaround prior to releasing this functionality.