openclaw - 💡(How to fix) Fix `/status` can report stale pre-compaction totals for already-compacted sessions [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#61865Fetched 2026-04-08 02:53:18
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
renamed ×1

For already-compacted sessions, /status can still report stale pre-compaction context totals (for example 151k/128k) even after the live prompt has already been reduced.

This appears to happen when status rendering prefers an older store snapshot or a whole-transcript estimate that still reflects the pre-compaction history.

Root Cause

This is operationally misleading:

  • it makes it look like compaction did not work
  • it makes ordinary chat look unsafe even when the reduced prompt is actually fine
  • it makes it much harder to debug real compaction problems because stale display and real runtime state diverge
RAW_BUFFERClick to expand / collapse

Summary

For already-compacted sessions, /status can still report stale pre-compaction context totals (for example 151k/128k) even after the live prompt has already been reduced.

This appears to happen when status rendering prefers an older store snapshot or a whole-transcript estimate that still reflects the pre-compaction history.

User-visible symptoms

In our repro on a Telegram thread session:

  • compaction had already succeeded
  • the agent itself could report a much smaller live context after compaction
  • but /status still showed a large pre-compaction number like 149k/128k, then 151k/128k

So operators saw a status card that looked like the session was still over budget, even though the prompt had already been reduced.

Repro shape

  1. Drive a session past compaction threshold.
  2. Let compaction succeed.
  3. Keep an older larger session total or a whole-transcript estimate available.
  4. Call /status.

Observed:

  • /status can prefer the stale larger total
  • the reported context usage can jump back to pre-compaction values

Expected:

  • once a session has compacted, /status should prefer:
    • a trustworthy post-compaction snapshot, or
    • unknown
  • it should not present a stale pre-compaction total as current truth for the active session

Why this matters

This is operationally misleading:

  • it makes it look like compaction did not work
  • it makes ordinary chat look unsafe even when the reduced prompt is actually fine
  • it makes it much harder to debug real compaction problems because stale display and real runtime state diverge

Related issue

This is adjacent to #45268, which covers misleading status output when totalTokensFresh=false.

This issue is narrower and later in the lifecycle:

  • the session has already compacted
  • the problem is that /status can still prefer a stale pre-compaction total or transcript-wide estimate instead of post-compaction truth

extent analysis

TL;DR

Update the /status endpoint to prefer post-compaction snapshots or return unknown when a trustworthy post-compaction snapshot is not available.

Guidance

  • Review the status rendering logic to ensure it prioritizes post-compaction snapshots over older store snapshots or whole-transcript estimates.
  • Verify that the compaction process correctly updates the session totals and that these updates are reflected in the /status endpoint.
  • Consider adding a check to return unknown when a trustworthy post-compaction snapshot is not available, to avoid displaying stale pre-compaction totals.
  • Investigate the session store and transcript estimate logic to ensure they are correctly updated after compaction.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The fix may require changes to the status rendering logic, compaction process, or session store updates. The exact implementation details are not provided in the issue.

Recommendation

Apply a workaround to update the /status endpoint to prefer post-compaction snapshots or return unknown when a trustworthy post-compaction snapshot is not available, as this will provide a more accurate representation of the session state.

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