fix(gateway): stop terminal progress from posting full commands to messaging chats#42420
Merged
Merged
Conversation
… messaging chats #41215 rendered a terminal tool call as a native ```bash fenced block on markdown platforms (Telegram, WhatsApp, Slack, and others), showing the full command with no truncation, in both all/new and verbose modes. That posted complete shell commands (heredocs, internal paths, destructive commands) into the chat before the final answer, visible to everyone in it. This restores the prior behavior: terminal progress shows the short, truncated preview line that every other tool already uses, capped at tool_preview_length. The supports_code_blocks capability flag is left in place for future use. CLI/TUI rendering is a separate path and was unaffected. Adds a regression test asserting terminal progress renders as a truncated preview, not a fenced bash block, even on a markdown-capable gateway. Fixes #41955
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Terminal tool progress no longer posts full shell commands into messaging chats — it goes back to the short truncated
terminal: "cmd…"preview every other tool uses.Root cause: #41215 (commit dde9c0d) rendered terminal commands as untruncated ```bash fenced blocks on markdown gateways (Telegram, WhatsApp, Slack, Discord) in all progress modes, dumping heredocs, internal paths, and destructive commands into the chat before the final answer — visible to everyone in it.
Changes
gateway/run.py: remove the_bash_blockrendering path; terminal progress uses the standard truncated preview (capped attool_preview_length) in all modesgateway/platforms/base.py:supports_code_blockscapability retained for future markdown features; comment updated to record that tool progress deliberately no longer renders commands as bash blocksValidation
bashcommand blockterminal: "set -e printf…"truncated previewtests/gateway/test_run_progress_topics.pyFixes #41955, #41732. Salvaged from #41950 onto current main; @GodsBoy's commit authorship preserved.
Infographic