aws / aws/amazon-q-developer-cli
Q CLI fails to compact when context is already too large
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
### Checks
- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
Linux 6.1.132-147.221.amzn2023.aarch64 - Amazon Linux 2023.7.20250414
### Expected behaviour
Q should either: 1) Proactively compact before reaching the limit, 2) Allow /compact to work even when context is full, or 3) Provide a different recovery mechanism when this situation occurs.
### Actual behaviour
```
Amazon Q is having trouble responding right now:
0: unhandled error (ValidationException)
1: service error
2: unhandled error (ValidationException)
3: Error { code: "ValidationException", message: "Input is too long.", aws_request_id: "f2fab539-563f-41cf-b7cd-510290c1bd1f" }
Location:
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
⚠️ This conversation is getting lengthy.
To ensure continued smooth operation, please use /compact to summarize the conversation.
> /compact
Amazon Q is having trouble responding right now:
0: unhandled error (ValidationException)
1: service error
2: unhandled error (ValidationException)
3: Error { code: "ValidationException", message: "Input is too long.", aws_request_id: "a431bfd3-d523-47a1-b671-16eea5b25f5e" }
Location:
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
⚠️ This conversation is getting lengthy.
To ensure continued smooth operation, please use /compact to summarize the conversation.
```
### Steps to reproduce
1. Have a long conversation with Q that includes large code blocks or extensive output
2. Continue until Q responds with "Input is too long" and suggests using /compact
3. Try to use /compact and observe that it also fails with "Input is too long"
### Environment
```yaml
[q-details]
version = "1.7.3"
hash = "3e4ae79d371315e80ddac772b43fff2cba314104"
date = "2025-04-10T05:47:30.444982Z (13d ago)"
variant = "minimal"
[system-info]
chip = ""
total-cores = 32
memory = "123.55 GB"
```
Contributor guide
Assessment
This issue has not been assessed yet.