amazon-q-developer-cli icon indicating copy to clipboard operation
amazon-q-developer-cli copied to clipboard

Gracefully handle context window validation errors by summarizing chat history

Open mschrage opened this issue 1 year ago • 1 comments

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:

  1. Handling validation exceptions sent from server
  2. Summarizing the existing chat context using an LLM call
  3. Allowing the session to continue rather than terminating

NOTE: we will need to remove server-side workaround prior to releasing this functionality.

mschrage avatar Mar 21 '25 17:03 mschrage