AI Explore.Source.Templates

One HTML document for Search, AI answers, and browser agents.

Switch to Simplified Chinese

OpenCode 自动摘要(Auto Compact)功能原理

  • 高森 模型产品
  • 齐岚 开发者体验

Published September 22, 2026

Auto Compact 会在会话接近模型窗口时,把较早的工具输出和对话折叠成摘要,腾出位置给新轮次。原理是“摘要替换原文”,不是无限窗口。折叠后,模型可能忘记某次失败的细节或你口头说过的约束。重要规则写进 AGENTS / 项目指令或配置,关键补丁用 git,不要指望摘要永远忠实。可以在配置里调整触发阈值,但阈值越大越贵。

  • 接近窗口 触发
  • 细节丢失 代价
  • 项目规则 + git 补救

长任务中途开新会话,往往比无限续聊更干净。

什么时候该新开会话#

  • 主题已经换了。
  • 刚完成一次大合并。
  • 模型开始重复已修过的错。

要点#

  • Compact 是折中,不是记忆魔法。
  • 硬约束写文件。
  • 跑飞就新开。

Was this helpful?

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. Figures are original to this site.

Last updated 2026-09-22.