Session wedged over the 1M window: repeated 400 prompt-too-long despite auto-compaction (v1.58.0)

未关闭
#891 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
ai, cli

调研方向

未指定源文件或测试。按照提供的长会话步骤重现连续三次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
  1. Run a long, tool-heavy session on a 1M-window model with the transcript near the window.
  2. Let auto-compaction run (or force it), then keep the session growing.
  3. 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:
    1. requested 1053393 (989393 messages + 64000 completion) - trace f1357f1faeee53e3709f485ef4468454
    2. requested 1055558 (991558 + 64000) - trace 028ff3b7779a4557810d3de8c158986f
    3. 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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CommandCodeAI/command-code 的其他 Issue

查看 CommandCodeAI/command-code 的全部 Issue

相似的 Issue

更多 AI Infra & Agents Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。