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

Rahulrajaram compaction fixes

Open rahulrajaram opened this issue 2 months ago • 0 comments

Fix: Conversation overflow, terminal responsiveness, and transcript accuracy

Changes

  1. Conversation overflow with token-based compaction
  • Fixed bug where message count was used instead of token count, causing overflow errors with large tool outputs
  • Track cumulative token usage (input + output) from backend MetadataEvent
  • Trigger proactive compaction at 98% of context window based on actual tokens
  • Add MetadataEvent support to ChatResponseStream
  1. Ctrl+C handling during hook execution
  • CLI no longer freezes during "Thinking..." state when hooks are running
  • Hooks now respond immediately to Ctrl+C instead of waiting for 30s timeout
  • Uses tokio::select! to monitor both hook completion and Ctrl+C signals
  1. Transcript sanitization
  • Fixed bug where hidden unicode characters appeared in transcript but not in messages sent to LLM
  • Moved transcript append to after sanitization step
  1. ANSI escape codes in /clear command
  • Replaced StyledText helpers with direct crossterm commands for consistent rendering across terminals

rahulrajaram avatar Nov 27 '25 03:11 rahulrajaram