hermes - ✅(Solved) Fix Telegram tool progress shows raw terminal date command instead of result [1 pull requests, 1 participants]

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…
GitHub stats
NousResearch/hermes-agent#13584Fetched 2026-04-22 08:05:33
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #13599: fix(gateway): update Telegram progress lines on tool completion

Description (problem / solution / changelog)

Summary

  • update gateway tool progress to handle tool.completed events
  • pass a short result preview from run_agent.py into completion callbacks
  • add regression coverage for completion markers and short result snippets in Telegram progress messages

Test Plan

  • python -m pytest tests/gateway/test_run_progress_topics.py -q

Closes #13584

Changed files

  • gateway/run.py (modified, +65/-1)
  • run_agent.py (modified, +10/-2)
  • tests/gateway/test_run_progress_topics.py (modified, +185/-0)

Code Example

💻 terminal: "date '+%Y-%m-%d %H:%M:%S %Z %z'"

---

💻 terminal: "date '+%Y-%m-%d %H:%M:%S %Z %z'"

---

💻 terminal: "2026-04-21 09:36:21 CDT -0500"
RAW_BUFFERClick to expand / collapse

Bug description

On Telegram, tool progress messages for terminal calls can show the raw shell command instead of the useful result. A simple date call ends up rendering progress like:

💻 terminal: "date '+%Y-%m-%d %H:%M:%S %Z %z'"

What the user actually wants to see there is the short terminal result, e.g. the real timestamp.

Why this happens

This appears to be a gap between the start-progress path and the completion path:

  • agent/display.py maps terminal previews to the command arg in build_tool_preview()
  • run_agent.py emits tool.started with that preview before execution
  • gateway/run.py currently only handles tool.started in the Telegram/gateway progress callback
  • tool.completed is ignored for progress rendering, so there is no chance to replace the raw command preview with the actual short stdout result

In practice, Telegram progress UX ends up showing the command string for short terminal commands like date instead of the result.

Reproduction

  1. Use Hermes through Telegram with tool progress enabled
  2. Trigger a request that causes a terminal date/time command, for example:
    • date '+%Y-%m-%d %H:%M:%S %Z %z'
    • date -u +"%Y-%m-%dT%H:%M:%SZ"
  3. Watch the progress message in Telegram

Actual behavior

Telegram shows the raw command preview, e.g.:

💻 terminal: "date '+%Y-%m-%d %H:%M:%S %Z %z'"

Expected behavior

For short successful terminal outputs, the Telegram progress line should update to something useful and human-facing, e.g.:

💻 terminal: "2026-04-21 09:36:21 CDT -0500"

or equivalent short stdout text.

Scope / suggested fix direction

A small, generic fix would be:

  1. Pass function_result into the existing tool.completed callback from run_agent.py
  2. Teach gateway/run.py to handle tool.completed for short successful terminal outputs
  3. Update the last progress line in place instead of leaving the raw command preview there forever

This would improve date and other short terminal one-liners without needing a weird date-specific special case.

Related issues

  • #263 is the closest ancestor: it improved Telegram tool progress beyond bare tool names, but the current preview path still only reflects tool.started
  • There are other nearby progress UX issues (#11075, #7161, #4882, #9136), but this specific terminal result-vs-command preview gap does not appear to be filed yet

extent analysis

TL;DR

Update the gateway/run.py to handle tool.completed events and replace the raw command preview with the actual short stdout result for short successful terminal outputs.

Guidance

  • Identify the tool.completed event in run_agent.py and pass the function_result to the callback.
  • Modify gateway/run.py to handle tool.completed events and update the last progress line with the short stdout result.
  • Verify that the Telegram progress message is updated correctly for short terminal commands like date.
  • Consider adding a check for the length of the stdout result to determine whether to update the progress message.

Example

# In run_agent.py
def tool_completed_callback(function_result):
    # Pass function_result to the callback
    emit('tool.completed', function_result)

# In gateway/run.py
def handle_tool_completed(event, function_result):
    # Update the last progress line with the short stdout result
    if event == 'tool.completed' and function_result:
        # Assuming function_result contains the short stdout result
        update_progress_message(function_result)

Notes

This fix assumes that the function_result contains the short stdout result of the terminal command. If this is not the case, additional modifications may be needed to extract the result.

Recommendation

Apply the suggested workaround by updating gateway/run.py to handle tool.completed events and replace the raw command preview with the actual short stdout result. This will improve the Telegram progress UX for short terminal commands without requiring a specific special case for each command.

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…

FAQ

Expected behavior

For short successful terminal outputs, the Telegram progress line should update to something useful and human-facing, e.g.:

💻 terminal: "2026-04-21 09:36:21 CDT -0500"

or equivalent short stdout text.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Telegram tool progress shows raw terminal date command instead of result [1 pull requests, 1 participants]