From ea1ff6b726dcad91f9d1186aeb25813b73ddb385 Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Sat, 25 Apr 2026 03:05:23 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@7920f8d4fdeb6e000795cf53751b341cc5776fb4 --- .openclaw-sync/source.json | 4 ++-- docs/.generated/config-baseline.sha256 | 4 ++-- docs/concepts/compaction.md | 5 +++++ docs/gateway/config-agents.md | 4 ++++ docs/reference/session-management-compaction.md | 8 ++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index c6bbd0efd..f51df8e95 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "26f06afb90acb7930b939e4a05064ce5bb236051", - "syncedAt": "2026-04-25T02:52:59.104Z" + "sha": "7920f8d4fdeb6e000795cf53751b341cc5776fb4", + "syncedAt": "2026-04-25T03:04:01.448Z" } diff --git a/docs/.generated/config-baseline.sha256 b/docs/.generated/config-baseline.sha256 index 661d9ede5..b4da6f725 100644 --- a/docs/.generated/config-baseline.sha256 +++ b/docs/.generated/config-baseline.sha256 @@ -1,4 +1,4 @@ -8f23e853ccde6cd021b84b32fe205f456f8516667683d16c9b56d6598f608989 config-baseline.json -037bf4a873587adb8349f531c0ad79cd4f90e01712f5aa5d8b4387be73538a7f config-baseline.core.json +71ef32b7723f64d4a84ac43bb6d41ff21e0d77a099b42e026d8b0d3d5301f917 config-baseline.json +cfab1910132ed23777005e0c650a13f44626b0450963f733e9de56a13323ae2b config-baseline.core.json 22d7cd6d8279146b2d79c9531a55b80b52a2c99c81338c508104729154fdd02d config-baseline.channel.json 86f615b7d267b03888af0af7ccb3f8232a6b636f8a741d522ff425e46729ba81 config-baseline.plugin.json diff --git a/docs/concepts/compaction.md b/docs/concepts/compaction.md index 25d188ac3..5a1f3dab2 100644 --- a/docs/concepts/compaction.md +++ b/docs/concepts/compaction.md @@ -113,6 +113,11 @@ the summary: /compact Focus on the API design decisions ``` +When `agents.defaults.compaction.keepRecentTokens` is set, manual compaction +honors that Pi cut-point and keeps the recent tail in rebuilt context. Without +an explicit keep budget, manual compaction behaves as a hard checkpoint and +continues from the new summary alone. + ## Using a different model By default, compaction uses your agent's primary model. You can use a more diff --git a/docs/gateway/config-agents.md b/docs/gateway/config-agents.md index 8a5e86e41..ad7fff44e 100644 --- a/docs/gateway/config-agents.md +++ b/docs/gateway/config-agents.md @@ -542,8 +542,10 @@ Periodic heartbeat runs. provider: "my-provider", // id of a registered compaction provider plugin (optional) timeoutSeconds: 900, reserveTokensFloor: 24000, + keepRecentTokens: 50000, identifierPolicy: "strict", // strict | off | custom identifierInstructions: "Preserve deployment IDs, ticket IDs, and host:port pairs exactly.", // used when identifierPolicy=custom + qualityGuard: { enabled: true, maxRetries: 1 }, postCompactionSections: ["Session Startup", "Red Lines"], // [] disables reinjection model: "openrouter/anthropic/claude-sonnet-4-6", // optional compaction-only model override notifyUser: true, // send brief notices when compaction starts and completes (default: false) @@ -562,8 +564,10 @@ Periodic heartbeat runs. - `mode`: `default` or `safeguard` (chunked summarization for long histories). See [Compaction](/concepts/compaction). - `provider`: id of a registered compaction provider plugin. When set, the provider's `summarize()` is called instead of built-in LLM summarization. Falls back to built-in on failure. Setting a provider forces `mode: "safeguard"`. See [Compaction](/concepts/compaction). - `timeoutSeconds`: maximum seconds allowed for a single compaction operation before OpenClaw aborts it. Default: `900`. +- `keepRecentTokens`: Pi cut-point budget for keeping the most recent transcript tail verbatim. Manual `/compact` honors this when explicitly set; otherwise manual compaction is a hard checkpoint. - `identifierPolicy`: `strict` (default), `off`, or `custom`. `strict` prepends built-in opaque identifier retention guidance during compaction summarization. - `identifierInstructions`: optional custom identifier-preservation text used when `identifierPolicy=custom`. +- `qualityGuard`: retry-on-malformed-output checks for safeguard summaries. Enabled by default in safeguard mode; set `enabled: false` to skip the audit. - `postCompactionSections`: optional AGENTS.md H2/H3 section names to re-inject after compaction. Defaults to `["Session Startup", "Red Lines"]`; set `[]` to disable reinjection. When unset or explicitly set to that default pair, older `Every Session`/`Safety` headings are also accepted as a legacy fallback. - `model`: optional `provider/model-id` override for compaction summarization only. Use this when the main session should keep one model but compaction summaries should run on another; when unset, compaction uses the session's primary model. - `notifyUser`: when `true`, sends brief notices to the user when compaction starts and when it completes (for example, "Compacting context..." and "Compaction complete"). Disabled by default to keep compaction silent. diff --git a/docs/reference/session-management-compaction.md b/docs/reference/session-management-compaction.md index 38254eb4b..679b87ddb 100644 --- a/docs/reference/session-management-compaction.md +++ b/docs/reference/session-management-compaction.md @@ -267,6 +267,10 @@ OpenClaw also enforces a safety floor for embedded runs: - Default floor is `20000` tokens. - Set `agents.defaults.compaction.reserveTokensFloor: 0` to disable the floor. - If it’s already higher, OpenClaw leaves it alone. +- Manual `/compact` honors an explicit `agents.defaults.compaction.keepRecentTokens` + and keeps Pi's recent-tail cut point. Without an explicit keep budget, + manual compaction remains a hard checkpoint and rebuilt context starts from + the new summary. Why: leave enough headroom for multi-turn “housekeeping” (like memory writes) before compaction becomes unavoidable. @@ -283,6 +287,10 @@ Plugins can register a compaction provider via `registerCompactionProvider()` on - Setting a `provider` forces `mode: "safeguard"`. - Providers receive the same compaction instructions and identifier-preservation policy as the built-in path. - The safeguard still preserves recent-turn and split-turn suffix context after provider output. +- Built-in safeguard summarization re-distills prior summaries with new messages + instead of preserving the full previous summary verbatim. +- Safeguard mode enables summary quality audits by default; set + `qualityGuard.enabled: false` to skip retry-on-malformed-output behavior. - If the provider fails or returns an empty result, OpenClaw falls back to built-in LLM summarization automatically. - Abort/timeout signals are re-thrown (not swallowed) to respect caller cancellation.