Files
nexus/wiki/concepts/Compaction.md

1.1 KiB
Raw Blame History

title, type, last_updated
title type last_updated
Compaction concept 2026-04-10

Definition

Compaction 是 OpenClaw 对话上下文压缩机制,用于在 token 接近上限时将历史对话压缩为摘要,释放上下文空间。

Safeguard Mode

在 safeguard 模式下OpenClaw 会预留 16K tokens 用于执行压缩操作:

  • reserveTokensFloor: 压缩预留 token 下限
  • 当模型 context window 较小时(如 deepseek-reasoner 的 16K预留空间与 context 相等导致实际可用空间为 0

Configuration Levels

  • 全局配置 (openclaw.json): 影响所有 Agent
  • Agent 级别配置 (routing rules): 影响特定 Agent/Channel优先级更高

Sources