github / github/copilot-cli

/compact cannot recover a session after the CAPI Responses payload reaches the 5 MB limit`

オープン
#4,424 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:context-memory area:sessions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
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

Image

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、CAPI Responses リクエストが 5 MB の上限に達したときに、インタラクティブな Copilot CLI セッションで失敗を再現し、その後 /compact を実行します。コンパクションとリクエストサイズ処理の経路を追跡します。/compact によってコンテキストを削減して既存のセッションを継続でき、完全なトランスクリプトがローカルに保存されたままになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。