Skip to content

status: Context line shows pre-compaction size instead of current context #72140

@giri-mt

Description

@giri-mt

Bug

After an auto-compaction, /status (and the post-message status card) shows the pre-compaction context size on the "Context" line, not the current size.

Example

⚙️ Compacted (106k → 36) • Context 36/200k (0%)

then on the next status:

🧮 Tokens: 6 in / 124 out
📚 Context: 76k/200k (38%) · 🧹 Compactions: 1

The 76k / 106k figures shown immediately after compaction are stale — they reflect what was in context right before compaction fired, not what's actually there now (which is the summary, ~a few hundred to a few thousand tokens).

This is misleading: users read "Context: 106k/200k (53%)" and think compaction didn't work.

Expected

The "Context" field should reflect the current post-compaction context size.

The pre-compaction peak is useful but belongs on the Compactions line as a delta, e.g.:

📚 Context: 36/200k (0%)
🧹 Compactions: 1 (last: 106k → 36)

Repro

  1. Let a session grow to >100k tokens.
  2. Trigger /compact or auto-compact.
  3. Run /status — observe Context line still shows pre-compaction figure until the next user turn refreshes it.

Notes

  • Reported in WhatsApp group surface, but the status card formatter is shared, so this affects all channels.
  • Likely a stale read of the context window snapshot taken before the compaction summary replaces history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions