openclaw - 💡(How to fix) Fix Bug: TUI truncates paths/commands, leaking ellipsis into model context [1 pull requests]

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…

The OpenClaw TUI (terminal UI) truncates long paths and commands in tool call display headers, replacing the truncated portion with . The web UI does not do this, it shows the full path. The truncated form from the TUI can leak back into the conversation when the assistant references the truncated display text in its replies, producing broken output like /usr/l…d.sh in sudoers snippets, command suggestions, etc.

This is a correctness bug, not just cosmetic. Truncated paths can end up in generated config files, sudoers entries, and command suggestions that are wrong or non-functional.

Root Cause

Root Cause (Source Code)

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug: TUI truncates paths/commands, leaking ellipsis into model context

Description

The OpenClaw TUI (terminal UI) truncates long paths and commands in tool call display headers, replacing the truncated portion with . The web UI does not do this, it shows the full path. The truncated form from the TUI can leak back into the conversation when the assistant references the truncated display text in its replies, producing broken output like /usr/l…d.sh in sudoers snippets, command suggestions, etc.

This is a correctness bug, not just cosmetic. Truncated paths can end up in generated config files, sudoers entries, and command suggestions that are wrong or non-functional.

Reproduction

  1. Use OpenClaw in the TUI (terminal UI), not the web chat.
  2. Have the assistant run or reference a command or path over ~120 characters, e.g.: /usr/lib/nagios/plugins/check_molly-guard.sh
  3. Observe the tool call display in the TUI, the path/command is truncated with at the end.
  4. In the same conversation, ask the assistant to reference or use that path. The truncated form (e.g. /usr/l…d.sh) may appear in the assistant's reply instead of the full path.
  5. Switch to the web UI, the same tool call shows the full, untruncated path.

Key Evidence

  • Web UI: Shows full paths/commands correctly. No truncation in tool call headers.
  • TUI: Truncates the same paths/commands, inserting where content is cut.
  • Leakage: The truncated TUI display text can end up in the assistant's generated replies, producing broken paths in sudoers entries, command suggestions, file references, etc.
  • Comparison: The web UI renders tool call detail using the same backend data, but does not apply the same truncation. The TUI renderer or its display formatter is the only place where the lossy truncation occurs.

Root Cause (Source Code)

The truncation happens in the OpenClaw source at:

  1. src/agents/tool-display-exec.ts, compactRawCommand(raw, maxLength = 120):

    • Normalizes whitespace, then does oneLine.slice(0, maxLength - 1) + "…"
    • This truncates from the end, cutting off filenames and command tails.
  2. src/agents/tool-display-common.ts, coerceDisplayValue():

    • Truncates string values at maxStringChars = 160 (default) with firstLine.slice(0, maxStringChars - 3) + "…"
    • Affects path-like display values in tool cards.

Both functions are used in the TUI rendering pipeline. The web UI apparently either doesn't use these same truncation functions, or renders from the untruncated source data.

Suggested Fix

  1. Short term: Remove or increase the truncation limit for the TUI so it matches the web UI behavior (which shows full paths).
  2. Better fix: For paths specifically, use middle truncation preserving both the start and the filename (e.g. /usr/lib/…/check_molly-guard.sh) rather than end truncation. For commands, keep the binary name visible and truncate arguments in the middle.
  3. Critical: Ensure that whatever display text the TUI shows, the underlying tool call data sent back to the model contains the full, untruncated path/command. The display truncation should never leak into the model's context window.

Environment

  • OpenClaw version: current stable (installed via npm)
  • Interface: TUI (terminal UI), reproduces the bug
  • Interface: Web UI, does not reproduce the bug; shows full paths
  • Host: Debian Linux (arm64)

Related Issues

  • #55770, proposes /verbose limit to configure the 120-char limit but does not change truncation direction or address TUI-specific leakage
  • #82121, "Leaked truncation sentinels (...(truncated)...) can appear in final assistant replies", related but about a different truncation marker
  • #4818, "TUI crashes when rendering long audio file paths", closed, but shows the TUI has a history of path rendering issues

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

openclaw - 💡(How to fix) Fix Bug: TUI truncates paths/commands, leaking ellipsis into model context [1 pull requests]