Session wedged over the 1M window: repeated 400 prompt-too-long despite auto-compaction (v1.58.0)
まだ誰も着手していません。
評価
調査の方向性
ソースファイルやテストは指定されていません。提供された長時間セッションの手順で、連続する3回の400失敗を再現し、その後、自動コンパクションとリトライの経路を追跡します。完了条件は、サイズ超過のリクエストがコンパクションされるか、その他の方法で縮小され、リトライ後もセッションが行き詰まったままにならないことです。
索引モデルが issue の本文から書いたものです。
説明
Summary
A long, tool-heavy session is stuck: every request fails with 400 This model's maximum context length is 1048576 tokens ... requested 1057726 (993726 in the messages, 64000 in the completion). The transcript only exceeds the window once the fixed 64k completion budget is added. Each continue retry appends the error text to the transcript, so the request grows ~+2.2k tokens per attempt and can never fit. Auto-compaction has already run twice and then reports "Conversation is already compact.", so the documented "prompt too long" recovery never clears the session.
Expected Behavior
Per docs (Context & Compaction): a too-long request is classified, the window is compacted on the spot, and the request is retried once - only a second consecutive failure surfaces. Auto-compaction Tier 3 should also fire at >= 90% of the window.
Actual Behavior
The 400 surfaces on every attempt (3 in a row). Compaction meta: count=2, tokensSaved=646529 total (last pass only 29011). After that, continue reports "Conversation is already compact." and the next request still overflows. The session is unusable without /rewind or /clear.
Steps to reproduce the issue
- Run a long, tool-heavy session on a 1M-window model with the transcript near the window.
- Let auto-compaction run (or force it), then keep the session growing.
- Type
continue- every request fails with the 400 above.
Command Code Version
1.58.0
Operating System
Windows
Terminal/IDE
No response
Shell
No response
Session file (optional)
No response
Fix prompt (optional)
If a compaction pass reclaims too little and the next request still overflows, escalate instead of backing off: force a tool-call trim (keep last 10) regardless of compact mode, or retry once with a reduced completion budget so the request can fit under the window.
Additional context
- session id: 272ee4d1-930f-41ec-8eea-5e3d715fc450 (fork of 80401b9d-fbd9-4b6c-9f2e-6a2a44813ef0)
- model: deepseek/deepseek-v4.1-flash; project slug: c-windows-system32
- three consecutive failures:
- requested 1053393 (989393 messages + 64000 completion) - trace f1357f1faeee53e3709f485ef4468454
- requested 1055558 (991558 + 64000) - trace 028ff3b7779a4557810d3de8c158986f
- requested 1057726 (993726 + 64000) - trace 17e437ff33af0695c0169e0bcd17147d
- lastCompactedAt: 2026-09-19T22:02:39.097Z
- session JSONL (9.2 MB) can be provided on request
- 主要言語
- 言語のデータがありません
- スター
- 4k
- フォーク
- 350
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommandCodeAI/command-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#855 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CommandCodeAI/command-code#841 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#655 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#608 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
CommandCodeAI/command-code#893 ·
CommandCodeAI/command-code の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliusBrussee/caveman#1102 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3263 ·
-
[Bug]: context-limit error parsing has no pattern for llama.cpp's "context size (N tokens)" phrasing オープンarea/compression area/local-models area/sessions comp/agent duplicate P2 sweeper:risk-session-state type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#117793 · コメント 1 件 ·
-
possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Mintplex-Labs/anything-llm#6415 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100