openclaw - 💡(How to fix) Fix Bug: Webchat /compact button runs file-level trim instead of LLM context compaction [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#58629Fetched 2026-04-08 01:59:56
View on GitHub
Comments
2
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

The webchat Control UI's /compact button dispatches sessions.compact (file-level JSONL line truncation, ~400-800ms) instead of compactEmbeddedPiSession (LLM-based context summarization). It reports success without actually reducing context token count.

Root Cause

The webchat Control UI's /compact button dispatches sessions.compact (file-level JSONL line truncation, ~400-800ms) instead of compactEmbeddedPiSession (LLM-based context summarization). It reports success without actually reducing context token count.

Fix Action

Workaround

Send /compact as a text message through a proper channel (Telegram, iMessage, or webchat slash command input) - this routes correctly to compactEmbeddedPiSession.

RAW_BUFFERClick to expand / collapse

Summary

The webchat Control UI's /compact button dispatches sessions.compact (file-level JSONL line truncation, ~400-800ms) instead of compactEmbeddedPiSession (LLM-based context summarization). It reports success without actually reducing context token count.

Expected behavior

Clicking the compact button in the webchat Control UI should trigger compactEmbeddedPiSession, which performs LLM-based context summarization and actually reduces the token count of the session.

Actual behavior

The button dispatches sessions.compact, which only does file-level JSONL line truncation. It completes in ~400-800ms and shows a 'completed' status, but the session's context token count is unchanged.

Workaround

Send /compact as a text message through a proper channel (Telegram, iMessage, or webchat slash command input) - this routes correctly to compactEmbeddedPiSession.

Environment

  • Discovered: 2026-03-30
  • Affects: webchat Control UI compact button

extent analysis

TL;DR

The webchat Control UI's compact button should be modified to dispatch compactEmbeddedPiSession instead of sessions.compact to correctly reduce the context token count.

Guidance

  • Verify the current behavior by checking the dispatched action when the compact button is clicked and confirm that the token count remains unchanged.
  • Investigate the code responsible for handling the compact button click event to identify why sessions.compact is being dispatched instead of compactEmbeddedPiSession.
  • Consider implementing a temporary workaround by instructing users to send /compact as a text message through a proper channel, as this correctly routes to compactEmbeddedPiSession.
  • Review the differences between sessions.compact and compactEmbeddedPiSession to understand the intended functionality and how to correctly implement the compact button's behavior.

Example

No code example is provided due to the lack of specific code details in the issue.

Notes

The provided workaround suggests that the issue is specific to the webchat Control UI's compact button and does not affect other channels, such as Telegram or iMessage.

Recommendation

Apply workaround: Instruct users to send /compact as a text message through a proper channel until the compact button's behavior can be corrected to dispatch compactEmbeddedPiSession. This ensures that users can still access the intended functionality while a permanent fix is being developed.

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…

FAQ

Expected behavior

Clicking the compact button in the webchat Control UI should trigger compactEmbeddedPiSession, which performs LLM-based context summarization and actually reduces the token count of the session.

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 Bug: Webchat /compact button runs file-level trim instead of LLM context compaction [2 comments, 2 participants]