Skip to content

feat(chat): enhance --resume to show complete last exchange context #2296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

khalid-bkr
Copy link

Summary

Enhances the q chat --resume functionality to provide better conversation continuity by showing the complete last exchange (user prompt + Amazon Q response) along with contextual summaries.

Changes

  • Display exact last user prompt and Amazon Q response when resuming
  • Show tool actions performed in the last interaction
  • Implement smart truncation for long messages (800/1200 char limits)
  • Provide enhanced context to model for better summaries
  • Use consistent Amazon Q branding in messaging

Benefits

  • Better mental context recovery when resuming after time gaps
  • Complete visibility into previous conversation state
  • Enhanced conversation continuity
  • Professional, consistent messaging

Testing

  • Tested with regular conversations
  • Tested with tool usage scenarios
  • Tested smart truncation with long messages
  • Verified backward compatibility

Implementation Details

  • Modified crates/chat-cli/src/cli/chat/mod.rs to enhance resume prompt generation
  • Added smart truncation logic (800 chars for user prompts, 1200 for responses)
  • Improved tool action display with meaningful context extraction
  • Maintained backward compatibility with existing resume functionality

Migration Note

This PR was moved from the autocomplete repository (aws/amazon-q-developer-cli-autocomplete) to the main repository (aws/amazon-q-developer-cli) as requested by the maintainers.

🤖 Assisted by Amazon Q Developer

Khaled Abu Baker added 2 commits July 13, 2025 23:33
- Display exact last user prompt and Amazon Q response when resuming
- Show tool actions performed in the last interaction
- Implement smart truncation for long messages (800/1200 char limits)
- Provide enhanced context to model for better conversation summaries
- Use consistent Amazon Q branding in messaging
- Improve conversation continuity when resuming after time gaps

🤖 Assisted by Amazon Q Developer
The main repository loads conversation state directly from database,
making the reload_serialized_state method unnecessary and unavailable.
@khalid-bkr khalid-bkr force-pushed the feat/enhance-chat-resume-context branch from 90b8a53 to 566feae Compare July 14, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant