/compact cannot recover a session after the CAPI Responses payload reaches the 5 MB limit`
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
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
- Continue an interactive Copilot CLI session until its request context reaches 5 MB.
- Submit another prompt.
- Observe the request-size error.
- Run
/compact. - 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 CAPI Responses 请求达到 5 MB 限制时,于交互式 Copilot CLI 会话中重现该故障,然后运行 /compact。跟踪压缩和请求大小处理路径;当 /compact 能够缩减上下文并继续现有会话,同时完整的记录仍存储在本地时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100