Skip to content

[TUI] backend DEBUG/INFO logs leak into Activity when display.tool_progress=verbose #31372

@hanzckernel

Description

@hanzckernel

Summary

In the TUI, setting display.tool_progress: verbose can surface ordinary Hermes backend runtime logs as visible Activity lines. The visible lines are not tool-progress details; they are Python logging records from the backend process, for example:

09:57:45 - agent.codex_runtime - DEBUG - Codex stream: backfilled ...
09:57:45 - run_agent - INFO - OpenAI client closed ... provider=openai-codex ...
09:57:45 - root - DEBUG - API Response received - Model: ... Usage: ...
09:57:45 - tools.browser_tool - DEBUG - cleanup_browser called ...

This makes the TUI look like backend/registry logs are leaking into the user-facing conversation surface after enabling verbose tool progress.

A screenshot is available from the reporter and can be added separately; omitted here to keep this initial report text-only.

Reproduction

  1. Use the TUI.
  2. Set display.tool_progress: verbose.
  3. Run a normal agent turn that makes model/tool calls.
  4. Observe DEBUG/INFO backend log records appearing in the TUI Activity feed/main screen.

Expected behavior

Verbose tool progress should show structured tool details, but ordinary backend runtime logs should remain in log files such as ~/.hermes/logs/agent.log / gateway.log unless there is an actual gateway startup/fatal diagnostic.

gateway.stderr should still be useful for startup failures and real transport/protocol diagnostics, but normal agent runtime logs should not be promoted to user-visible Activity.

Actual behavior

Backend Python logging records are written to stderr and the TUI displays them as gateway.stderr Activity entries.

The local path appears to be:

  • tui_gateway/server.py creates the TUI agent with verbose_logging=_load_tool_progress_mode() == "verbose".
  • agent/agent_init.py calls setup_verbose_logging() when agent.verbose_logging is true.
  • hermes_logging.py::setup_verbose_logging() adds a DEBUG logging.StreamHandler(); by default this writes to stderr.
  • ui-tui/src/gatewayClient.ts publishes every stderr line as gateway.stderr.
  • ui-tui/src/app/createGatewayEventHandler.ts pushes every gateway.stderr line into Activity.

Related work

Possibly related but not a duplicate:

Suggested fix direction

Decouple TUI verbose tool progress from Python console/stderr logging. For example:

  • Keep structured verbose tool details flowing through TUI events.
  • Keep backend runtime logs in log files.
  • Do not add a stderr console handler for ordinary agent logging in TUI mode, or filter known Hermes logging records before publishing them as user-visible gateway.stderr Activity.
  • Preserve stderr surfacing for startup failures and true gateway diagnostics.

Workaround

Set:

hermes config set display.tool_progress new

Then restart the TUI process. This keeps basic progress while avoiding the verbose path that enables backend console logging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/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