/compact cannot recover a session after the CAPI Responses payload reaches the 5 MB limit`
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
### Describe the bug
### Description
When a Copilot CLI session reaches the 5 MB CAPI Responses request limit, normal prompts fail as expected—but `/compact` also fails. This leaves no way to reduce the active context while preserving and continuing the session. Basically this kills my session and I cannot continue in it which is a huge kill in productivity and flow.
### Error
> The request is too large to send through CAPI Responses. Try shortening the conversation or prompt. (5.0 MB request; 5.0 MB limit)
>
### Environment
- GitHub Copilot CLI: `1.0.78-0`
- OS: macOS `26.5.2`
- Architecture: `arm64`

### Affected version
1.0.78-0
### Steps to reproduce the behavior
## Steps to reproduce
1. Continue an interactive Copilot CLI session until its request context reaches 5 MB.
2. Submit another prompt.
3. Observe the request-size error.
4. Run `/compact`.
5. Observe that compaction cannot complete either.
### Expected behavior
## Expected behavior
`/compact` should remain usable after the normal request limit is reached, perhaps by truncating or chunking context locally before requesting a summary. The complete transcript should remain stored locally.
Ideally, Copilot CLI should also compact automatically before reaching an unrecoverable size.
### Actual behavior
Both regular prompts and `/compact` are blocked. The session history still exists, but the session cannot be continued; the only practical workaround is starting a new session and manually transferring context.
### Additional context
Additional detail
This occurs when the UI reports only approximately 69–70% context usage (about 1.1M context shown), rather than near 100%.
The context meter appears to track token capacity, while CAPI applies a separate 5 MB serialized-request limit. The CLI neither warns about this lower effective limit nor compacts before reaching it.
I have attached a screenshot showing the session at 70% context when the failure occurred.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il malfunzionamento in una sessione interattiva di Copilot CLI quando la richiesta CAPI Responses raggiunge il limite di 5 MB, quindi esegui /compact. Traccia i percorsi di compattazione e di gestione delle dimensioni della richiesta; il lavoro è completato quando /compact può ridurre il contesto e continuare la sessione esistente, mentre la trascrizione completa rimane memorizzata localmente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100