openclaw - 💡(How to fix) Fix [Feature]: Add user-visible and confirmable context compaction mechanisms [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#58830Fetched 2026-04-08 02:32:13
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Introduce user-visible notifications and optional confirmation and modification for automatic context compression, trimming, or message dropping.

Root Cause

Introduce user-visible notifications and optional confirmation and modification for automatic context compression, trimming, or message dropping.

Code Example

{
        "contextCompaction": {
          "mode": "notify" ,
          "preview": true,
          "allowRollback": true
        }
      }
RAW_BUFFERClick to expand / collapse

Summary

Introduce user-visible notifications and optional confirmation and modification for automatic context compression, trimming, or message dropping.

Problem to solve

OpenClaw automatically performs context management when conversation history becomes too long, including:

  • Truncating earlier messages
  • Summarizing past interactions
  • Dropping oversized messages

However, these operations are currently silent and opaque to users.

This creates several issues:

  • Potential loss of critical information without user awareness
  • Summaries may omit important details or introduce inaccuracies
  • Users cannot verify or correct compressed content
  • Difficult debugging when agent behavior changes due to hidden context loss

In long-running or complex tasks, this can lead to degraded output quality and unpredictable agent behavior.

Proposed solution

Introduce transparent and controllable context compaction mechanisms:

  1. Visibility:

    • Notify users when context is truncated, summarized, or dropped
    • Provide metadata (e.g., tokens reduced, messages affected)
  2. Preview:

    • Show the generated summary before applying it
    • Highlight which parts are being removed or compressed
  3. Confirmation:

    • Allow users to approve/reject compression results
    • Configurable modes:
      • auto (current behavior)
      • notify-only
      • require-confirmation
  4. Recovery:

    • Keep a temporary buffer of original messages
    • Allow rollback or re-expansion of compressed context
  5. Configuration:

    • Global and per-agent settings
    • Example:
       {
        "contextCompaction": {
          "mode": "notify" ,
          "preview": true,
          "allowRollback": true
        }
      }
  6. Developer hooks:

    • Emit events/logs when compaction occurs
    • Allow custom compaction strategies

Alternatives considered

No response

Impact

Affected:

  • Users running long conversations or complex agent workflows
  • Multi-step reasoning tasks

Severity:

  • Medium to High (can silently degrade correctness)

Frequency:

  • Common in long sessions

Consequence:

  • Loss of important context
  • Incorrect or incomplete agent outputs
  • Reduced trust in system behavior

Evidence/examples

No response

Additional information

No response

extent analysis

TL;DR

Implementing transparent and controllable context compaction mechanisms, including user notifications, preview, confirmation, and recovery options, can address the issues caused by silent context management in OpenClaw.

Guidance

  • Introduce user-visible notifications when context is truncated, summarized, or dropped to increase transparency.
  • Implement a preview feature to show the generated summary before applying it, allowing users to verify the changes.
  • Add configurable modes (auto, notify-only, require-confirmation) to give users control over the compaction process.
  • Consider keeping a temporary buffer of original messages to allow rollback or re-expansion of compressed context.

Example

{
  "contextCompaction": {
    "mode": "require-confirmation",
    "preview": true,
    "allowRollback": true
  }
}

This example configuration requires user confirmation before applying context compaction, shows a preview of the changes, and allows rollback of compressed context.

Notes

The proposed solution aims to address the issues caused by silent context management, but its effectiveness may depend on the specific use cases and user behavior. Further testing and evaluation may be necessary to ensure the solution meets the requirements.

Recommendation

Apply the proposed workaround by introducing transparent and controllable context compaction mechanisms, as it provides a more user-centric and flexible approach to context management.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING