Bug Description
When a conversation accumulates more than 100 images/documents, both regular API calls and /compact fail with:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"too many images and documents: 101 + 0 > 100"}}
Problem
- Auto-compact is enabled but doesn't trigger before reaching the 100 image/document limit
- Once the limit is exceeded,
/compact also fails (it needs to send context to API to create summary)
- The only recovery is
/clear, losing all conversation context
Expected Behavior
Auto-compact should trigger proactively when approaching the image/document limit (e.g., at 80-90 images), not just based on token count.
Environment
- Claude Code version: 2.1.44
- Installation: Native (/usr/bin/claude)
- Platform: Linux (Debian)
Suggested Fix
Add image/document count check to auto-compact trigger logic, in addition to token-based triggers.
Bug Description
When a conversation accumulates more than 100 images/documents, both regular API calls and
/compactfail with:Problem
/compactalso fails (it needs to send context to API to create summary)/clear, losing all conversation contextExpected Behavior
Auto-compact should trigger proactively when approaching the image/document limit (e.g., at 80-90 images), not just based on token count.
Environment
Suggested Fix
Add image/document count check to auto-compact trigger logic, in addition to token-based triggers.