Repository navigation
Closed
Labels
P2Medium — degraded but workaround existsMedium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryGateway runner, session dispatch, deliverycomp/tuiTerminal UI (ui-tui/ + tui_gateway/)Terminal UI (ui-tui/ + tui_gateway/)type/bugSomething isn't workingSomething isn't working
Description
When you run /compress in the TUI or Desktop client, it works — the context gets compressed — but the result summary never appears. You'd expect to see something like:
Compressed: 47 → 12 messages
Approx request size: ~18,400 → ~4,200 tokens
The lifecycle status messages do show up fine (🗜️ Compacting context..., ⚠️ Session compressed N times...), but the actual before/after stats are silently dropped.
What's happening
The TUI gateway handles /compress in _mirror_slash_side_effects (tui_gateway/server.py, around line 8633). It calls _compress_session_history() directly and then emits an updated session.info — but it never calls summarize_manual_compression(), so the stats just get lost.
The other two code paths both do this correctly:
| Path | Where | Calls summarize_manual_compression? |
|---------------------------|----------------------------------------------------------------|-------------------------------------|
| CLI (non-TUI) | cli.py, _manual_compress ~line 8188 | ✅ yes |
| Gateway (Feishu/Telegram) | gateway/slash_commands.py, _handle_compress_command ~line 2506 | ✅ yes |
| TUI Gateway | tui_gateway/server.py, _mirror_slash_side_effects ~line 8633 | ❌ no |
Fix
In the compress branch of _mirror_slash_side_effects, snapshot the session history before calling _compress_session_history(), then call summarize_manual_compression() afterward and emit the result. The most consistent delivery mechanism is probably agent._vprint(), which is already how the compression-count warning gets surfaced.
summarize_manual_compression is already imported in the same file and used by the session.compress RPC handler around line 4618, so this is roughly a 10-line change.
Environment
- Hermes v0.16.0
- TUI / Desktop client
Metadata
Metadata
Assignees
Labels
P2Medium — degraded but workaround existsMedium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryGateway runner, session dispatch, deliverycomp/tuiTerminal UI (ui-tui/ + tui_gateway/)Terminal UI (ui-tui/ + tui_gateway/)type/bugSomething isn't workingSomething isn't working
Activity
fix(tui): /compress shows a before/after summary (#46686)
teknium1 commentedon Jun 21, 2026
Fixed in #50303. The TUI /compress command now reports a before/after summary (Compressed: N → M messages / ~X → ~Y tokens) via summarize_manual_compression(), matching the CLI and gateway paths. #50303
Sync hermes-agent with upstream main (NousResearch#45)
Sync homelab/main to current upstream/main (NousResearch#46)
feat: live card tool progress chain + commentary accumulation (#21)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)
fix(tui): /compress shows a before/after summary (NousResearch#46686)