-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Bug: TUI truncates paths/commands, leaking ellipsis into model context #87936
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.shin 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
/usr/lib/nagios/plugins/check_molly-guard.sh…at the end./usr/l…d.sh) may appear in the assistant's reply instead of the full path.Key Evidence
…where content is cut.Root Cause (Source Code)
The truncation happens in the OpenClaw source at:
src/agents/tool-display-exec.ts,compactRawCommand(raw, maxLength = 120):oneLine.slice(0, maxLength - 1) + "…"src/agents/tool-display-common.ts,coerceDisplayValue():maxStringChars = 160(default) withfirstLine.slice(0, maxStringChars - 3) + "…"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
/usr/lib/…/check_molly-guard.sh) rather than end truncation. For commands, keep the binary name visible and truncate arguments in the middle.Environment
Related Issues
/verbose limitto configure the 120-char limit but does not change truncation direction or address TUI-specific leakage...(truncated).../[..., N more characters truncated]) can appear in final assistant replies #82121, "Leaked truncation sentinels (...(truncated)...) can appear in final assistant replies", related but about a different truncation marker