Skip to content

TUI: compression count warning (accuracy degrade) is silently swallowed #36908

@laoli-no1

Description

@laoli-no1

Description

Compression count warning is lost in TUI mode. When a session is compressed 2+ times, the accuracy degradation warning should be shown to the user, but in TUI it is silently swallowed.

Root Cause

agent/conversation_compression.py line 569-576 uses agent._vprint() to output the warning:

if _cc >= 2:
    agent._vprint(
        f"{agent.log_prefix}⚠️  Session compressed {_cc} times — "
        f"accuracy may degrade. Consider /new to start fresh.",
        force=True,
    )

_vprint() writes to stdout, which works fine in CLI mode (hermes chat). In TUI mode, the Ink UI does not consume stdout, so the warning never reaches the user.

The correct channel for TUI delivery is agent._compression_warning + agent._emit_status() / status_callback, which is used elsewhere (e.g. aux model unavailable). The compression count warning skips this path.

Impact

  • TUI users compress 2+ times with zero feedback about degrading accuracy.
  • CLI users see the warning normally.

Reproduction

  1. hermes --tui
  2. Run a long enough conversation to trigger compression (or use /compress twice).
  3. No warning appears in the TUI interface.
  4. Check ~/.hermes/logs/agent.log — the warning is absent there too (it went to stdout).

Suggested Fix

Route the compression count warning through agent._compression_warning + agent._emit_status() instead of _vprint(). This ensures delivery via status_callback to all platforms (TUI, Telegram, Discord, etc.).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildercomp/tuiTerminal UI (ui-tui/ + tui_gateway/)type/bugSomething isn't working

    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