openclaw - 💡(How to fix) Fix Feature request: expose compacted summary content in the after_compaction plugin hook payload [2 comments, 2 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#83936Fetched 2026-05-20 03:46:19
View on GitHub
Comments
2
Participants
2
Timeline
20
Reactions
1
Author
Timeline (top)
labeled ×7mentioned ×4subscribed ×4commented ×2

The before_compaction / after_compaction plugin hooks are documented as observation-only — they let a plugin observe or annotate a compaction cycle, but the payload does not expose the compacted summary content. This makes it impossible for a plugin to act on what was distilled without reaching outside the documented hook contract.

(Please correct me if a later version already exposes this — this is based on the current /plugins/hooks docs.)

Root Cause

The before_compaction / after_compaction plugin hooks are documented as observation-only — they let a plugin observe or annotate a compaction cycle, but the payload does not expose the compacted summary content. This makes it impossible for a plugin to act on what was distilled without reaching outside the documented hook contract.

(Please correct me if a later version already exposes this — this is based on the current /plugins/hooks docs.)

Fix Action

Fix / Workaround

Why the filesystem workaround is fragile

RAW_BUFFERClick to expand / collapse

Summary

The before_compaction / after_compaction plugin hooks are documented as observation-only — they let a plugin observe or annotate a compaction cycle, but the payload does not expose the compacted summary content. This makes it impossible for a plugin to act on what was distilled without reaching outside the documented hook contract.

(Please correct me if a later version already exposes this — this is based on the current /plugins/hooks docs.)

Use case

Knowledge-management / external-memory plugins want to route distilled knowledge into a downstream store at the moment of compaction — e.g. promoting durable facts out of a daily log into a curated long-term vault. To classify and route distilled items, the plugin needs the compacted summary text. Today the only way to obtain it is to locate and parse OpenClaw's internal compacted-log files on disk.

Why the filesystem workaround is fragile

  • The on-disk log location and format are internal implementation details with no stability contract. A routine refactor can break a plugin silently — the hook still fires, the parse just returns nothing.
  • Timing: after_compaction fires on the event; the plugin then reads the file, with no documented guarantee the summary write has flushed.
  • The plugin must re-parse unstructured prose rather than consume structured output OpenClaw has already produced.

A payload field is a contract. A scraped internal file is not.

Proposed change

Include the compacted summary content in the after_compaction payload — e.g. a summary (or compactedText) field alongside the existing metadata. If exposing full content by default is a concern, a structured list of distilled items, or an opt-in flag at hook registration, would equally remove the need to scrape internal files.

Related

  • #81925 — after_compaction emission edge case
  • #8606 — hook event for context pruning (adjacent lifecycle point, different need)

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

openclaw - 💡(How to fix) Fix Feature request: expose compacted summary content in the after_compaction plugin hook payload [2 comments, 2 participants]