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

Context files are being duplicated on every message

Open brandonskiser opened this issue 1 year ago • 0 comments

Every user message has context files included. This drastically increases the token usage, and thus needs to be addressed.

https://github.com/aws/amazon-q-developer-cli/blob/8179b325a4cec41d9a914266ec76fd65b4007c05/crates/q_cli/src/cli/chat/conversation_state.rs#L139-L168

We already prepend the context files on every request sent to the model, so it should be safe to simply remove the logic that adds context files to new user messages. https://github.com/aws/amazon-q-developer-cli/blob/8179b325a4cec41d9a914266ec76fd65b4007c05/crates/q_cli/src/cli/chat/conversation_state.rs#L397

brandonskiser avatar Apr 09 '25 04:04 brandonskiser