feat(gateway): render terminal commands as bare fenced code blocks in chat#42576
Merged
Conversation
… chat Terminal tool progress on markdown-capable gateways (Telegram, Slack, Discord, WhatsApp, Matrix, Weixin, Feishu) renders the full command in a fenced code block again, in all/new AND verbose modes — gated on the adapter's supports_code_blocks capability. Plain-text platforms keep the short truncated preview. No language tag is emitted: Slack mrkdwn renders a '```bash' fence with 'bash' as a literal first code line, so a bare '```' fence is used, which renders correctly on every platform that supports blocks. This restores the #41215 feature (removed in #41950 due to the command showing in group chats) as the default. For a personal assistant the command display is desired; the group-chat concern is a preference, not a vulnerability.
Contributor
🔎 Lint report:
|
a249169329-cpu
pushed a commit
to a249169329-cpu/hermes-agent
that referenced
this pull request
Jun 9, 2026
… chat (NousResearch#42576) Terminal tool progress on markdown-capable gateways (Telegram, Slack, Discord, WhatsApp, Matrix, Weixin, Feishu) renders the full command in a fenced code block again, in all/new AND verbose modes — gated on the adapter's supports_code_blocks capability. Plain-text platforms keep the short truncated preview. No language tag is emitted: Slack mrkdwn renders a '```bash' fence with 'bash' as a literal first code line, so a bare '```' fence is used, which renders correctly on every platform that supports blocks. This restores the NousResearch#41215 feature (removed in NousResearch#41950 due to the command showing in group chats) as the default. For a personal assistant the command display is desired; the group-chat concern is a preference, not a vulnerability.
wachoo
pushed a commit
to wachoo/hermes-agent
that referenced
this pull request
Jun 10, 2026
… chat (NousResearch#42576) Terminal tool progress on markdown-capable gateways (Telegram, Slack, Discord, WhatsApp, Matrix, Weixin, Feishu) renders the full command in a fenced code block again, in all/new AND verbose modes — gated on the adapter's supports_code_blocks capability. Plain-text platforms keep the short truncated preview. No language tag is emitted: Slack mrkdwn renders a '```bash' fence with 'bash' as a literal first code line, so a bare '```' fence is used, which renders correctly on every platform that supports blocks. This restores the NousResearch#41215 feature (removed in NousResearch#41950 due to the command showing in group chats) as the default. For a personal assistant the command display is desired; the group-chat concern is a preference, not a vulnerability.
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
… chat (NousResearch#42576) Terminal tool progress on markdown-capable gateways (Telegram, Slack, Discord, WhatsApp, Matrix, Weixin, Feishu) renders the full command in a fenced code block again, in all/new AND verbose modes — gated on the adapter's supports_code_blocks capability. Plain-text platforms keep the short truncated preview. No language tag is emitted: Slack mrkdwn renders a '```bash' fence with 'bash' as a literal first code line, so a bare '```' fence is used, which renders correctly on every platform that supports blocks. This restores the NousResearch#41215 feature (removed in NousResearch#41950 due to the command showing in group chats) as the default. For a personal assistant the command display is desired; the group-chat concern is a preference, not a vulnerability.
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 on markdown-capable gateways (Telegram, Slack, Discord, WhatsApp, Matrix, Weixin, Feishu) renders the full command in a fenced code block again — in
all/newANDverbosemodes — and no longer prints a literalbashline on Slack.Restores the #41215 feature that #41950 removed. For a personal assistant, seeing the command your agent ran is the desired default; the "full command visible in a group chat" concern is a preference, not a vulnerability, and plain-text platforms still fall back to the short truncated preview.
Changes
gateway/run.py:progress_callbackbuilds a fenced block for theterminaltool when the adapter setssupports_code_blocks, wired into both the verbose branch and the all/new branch. Bare```fence — no language tag.gateway/platforms/base.py: updated thesupports_code_blocksdoc comment to reflect that tool progress uses it again.tests/gateway/test_run_progress_topics.py: inverted the fix(gateway): stop terminal progress from posting the full command to messaging chats #41950 regression test to assert the fenced block is present (nobashtag, full command body, no truncated preview); the existing truncation tests are unaffected (they pass{}args, so the code-block gate never fires).Why no language tag
Slack
mrkdwndoes not support syntax-highlight language hints — a```bashfence rendersbashas a literal first code line. A bare```fence renders correctly on every platform that supports code blocks.Validation
supports_code_blocks=True(Telegram/Slack/Discord/…)💻 terminal\n```\n<full command>\n```— bare fence, full commandterminal: "set -euo…"truncated preview (unchanged)E2E-verified the real
progress_callbackpath on a code-block adapter (fence present, nobashtag, full command) and a plain adapter (truncated preview).tests/gateway/test_run_progress_topics.py: 30/30 pass.Infographic