Skip to content

Context compression capability will not be triggered automatically. #4360

Closed

Description

@andotorg

What happened

The underlying system actually has "manual compression" and "context diagnostics" capabilities; the main problem is that these capabilities are not exposed in the sending area and are not automatically triggered during high water levels.

How to reproduce

1、上下文窗口占满出现提示

Image

Environment

  • source build

Logs, screenshots, or additional context

No response

Activity

  1. changed the title [-]底层其实具备“手动压缩”和“上下文诊断”能力,问题主要是没有在发送区暴露,也没有在高水位时自动触发[/-] [+]Context compression capability will not be triggered automatically.[/+] on Aug 31, 2026
  2. andotorg commented on Sep 1, 2026

    @andotorg
    Author
    Image I want merge request , >= 60% enable automatically compression.
  3. andotorg commented on Sep 1, 2026

    @andotorg
    Author
    Image
  4. ggbdpq commented on Sep 4, 2026

    @ggbdpq
    Contributor

    对照当前 main(22715e84f)核实了一下,这个 issue 描述的两个问题在最新代码里都已经有解了:

    1. 高水位自动压缩——已随 #4348(2026-08-31,和本 issue 同一天提交)落地:mid-turn 容量触发会以 context_limit 为原因自动发起 history compaction;随后 #4486(09-02)把估算锚定到真实 provider usage,#4653(09-03)改为由 provider 决定容量判定。另一份带生产数据的报告 #4634 也证实触发器现在会正常开火。

    2. 手动压缩入口——两个 surface 都有 /compact:桌面端 composer(#2612,08-10 起)和 CLI/TUI 的 slash 命令(pi-tui-runner.ts,Usage: /compact)。

    你的环境写的是 source build 但没有提交号——大概率早于 #4348。麻烦:

    1. 更新到最新 main(或 09-03 之后的提交)重试;
    2. 如果高水位下仍然不触发,很可能是压缩尝试了但 failOpen(看起来像"没触发")——这正是 History compaction always fails open on kimi-coding-plan/k3-256k: summarizer instruction as system prompt is ignored and breaks prefix cache #4634 追踪的 provider 形态问题,欢迎在那边补充你的模型/连接信息。

    如果更新后仍有问题,请附上 build commit 和 surface(desktop / TUI),我们再继续排查。

  5. Astro-Han commented on Sep 17, 2026

    @Astro-Han
    Contributor

    Proactive high-water compaction landed in #4348 (36f058c90): a mid-turn capacity trigger now starts history compaction with reason: 'context_limit' (packages/runtime/src/ai-sdk-compaction.ts:891 and :948), and #4486 and #4653 later moved the capacity judgement onto real provider usage. Manual /compact is available in both the Desktop composer and the CLI/TUI slash commands. The source build in the report predates those changes. Closing as fixed; if compaction is attempted on your provider but fails open, that case is tracked in #4634 and your model and connection details are welcome there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions