Skip to content

fix(gateway): cap terminal code-block preview in non-verbose mode - #42729

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-db4dd3a4
Jun 9, 2026
Merged

fix(gateway): cap terminal code-block preview in non-verbose mode#42729
teknium1 merged 1 commit into
mainfrom
hermes/hermes-db4dd3a4

Conversation

@teknium1

@teknium1 teknium1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Long and multi-line terminal commands no longer render as huge blocks in non-verbose gateway tool progress.

The markdown code-block change emitted args['command'] in full in both verbose and non-verbose (all/new) modes, so terminal commands bypassed the tool_preview_length cap (default 40) that the non-terminal preview path applies. A long pipeline or heredoc rendered as a wall of text (Chris Silvestri's report). Root cause: the fenced-block branch had no truncation path.

Changes

  • gateway/run.py: build two variants — _code_block_full (verbose, uncapped) and _code_block_short (non-verbose: first line only, capped at tool_preview_length, ... marker for truncation/multi-line). Both keep the bare fence (no bash tag).
  • tests/gateway/test_run_progress_topics.py: corrected the non-verbose test (it asserted the full multi-line body was present — i.e. asserted the bug); added a verbose-mode test asserting the full command IS shown.

Validation

mode command rendered
verbose multi-line full command, fenced
all long single-line rg --json --hidden --glob '!.git' 'su... fenced
all multi-line set -euo pipefail ... fenced
all short unchanged, fenced
plain-text platform any short line (no fence)

tests/gateway/test_run_progress_topics.py — 31 passed.

Infographic

terminal-preview-cap-fix

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-db4dd3a4 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10605 on HEAD, 10603 on base (🆕 +2)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5558 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery tool/terminal Terminal execution and process management labels Jun 9, 2026
@teknium1
teknium1 merged commit 8d99b5b into main Jun 9, 2026
23 checks passed
@teknium1
teknium1 deleted the hermes/hermes-db4dd3a4 branch June 9, 2026 09:28
a249169329-cpu pushed a commit to a249169329-cpu/hermes-agent that referenced this pull request Jun 9, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…2729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
ether-btc pushed a commit to ether-btc/hermes-agent that referenced this pull request Jun 15, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 17, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
donbowman pushed a commit to donbowman/hermes-agent that referenced this pull request Jul 13, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…usResearch#42729)

The markdown code-block change rendered args['command'] in full in both
verbose AND non-verbose (all/new) modes, so a long or multi-line terminal
command bypassed the tool_preview_length cap (default 40) and rendered as
a huge block. Non-verbose now collapses to a single line capped at the
preview length while keeping the fence; verbose keeps the full command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants