hermes - 💡(How to fix) Fix [Bug] Gateway agent runs long-blocking terminal commands on messaging platforms with no user feedback [1 comments, 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#11631Fetched 2026-04-18 05:59:45
View on GitHub
Comments
1
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1

When running on messaging platforms (Feishu/Lark, Telegram, Discord, etc.), the Hermes gateway agent frequently executes long-running terminal commands (e.g., flutter build, claude -p, docker compose up, npm install) that can block for minutes. During this time, the user receives zero feedback that the agent is still working. The user then sends follow-up messages, triggering the interrupt mechanism, which creates a frustrating loop of "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal)."

Error Message

ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=51/90 | tool=terminal
ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=7/90 | tool=terminal

Root Cause

When running on messaging platforms (Feishu/Lark, Telegram, Discord, etc.), the Hermes gateway agent frequently executes long-running terminal commands (e.g., flutter build, claude -p, docker compose up, npm install) that can block for minutes. During this time, the user receives zero feedback that the agent is still working. The user then sends follow-up messages, triggering the interrupt mechanism, which creates a frustrating loop of "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal)."

Code Example

ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=51/90 | tool=terminal
ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=7/90 | tool=terminal
RAW_BUFFERClick to expand / collapse

Description

When running on messaging platforms (Feishu/Lark, Telegram, Discord, etc.), the Hermes gateway agent frequently executes long-running terminal commands (e.g., flutter build, claude -p, docker compose up, npm install) that can block for minutes. During this time, the user receives zero feedback that the agent is still working. The user then sends follow-up messages, triggering the interrupt mechanism, which creates a frustrating loop of "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal)."

Reproduction

  1. Start Hermes gateway connected to Feishu/Telegram
  2. Ask the agent to perform a task that requires a long terminal command (e.g., "build an APK", "run tests")
  3. The agent calls the terminal tool with a command that takes 2-10 minutes
  4. User sees no response for minutes, assumes the bot is dead
  5. User sends a new message -> gets "⚡ Interrupting current task" response
  6. Agent restarts the task -> blocks again -> repeat

Observed Behavior

  • Agent idle timeout triggers after 1800s with last_activity=executing tool: terminal
  • The interrupt acknowledgment is only sent after the user messages, not proactively
  • On CLI, the user sees spinners and tool output; on messaging platforms, there is complete silence during tool execution

Expected Behavior

When a terminal command has been running for more than N seconds (e.g., 30s), the gateway should proactively send a status update to the user on the messaging platform, e.g.:

"⏳ Still working... (running terminal command, 2 min elapsed)"

This should be configurable (threshold, enabled/disabled per platform).

Environment

  • Hermes Agent v0.9.x (gateway mode)
  • Platform: Feishu (Lark), likely affects all messaging platforms
  • Model: any (issue is in gateway layer, not model)

Logs

ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=51/90 | tool=terminal
ERROR gateway.run: Agent idle for 1803s (timeout 1800s) in session agent:main:feishu:dm:oc_... | last_activity=executing tool: terminal | iteration=7/90 | tool=terminal

extent analysis

TL;DR

Implement a proactive status update mechanism in the Hermes gateway agent to send periodic updates to the user when a terminal command has been running for more than a configurable threshold.

Guidance

  • Introduce a timer or a separate thread to monitor the execution time of terminal commands and send status updates to the user at regular intervals (e.g., every 30 seconds) if the command exceeds the threshold.
  • Configure the threshold value (e.g., 30 seconds) and the update interval to be adjustable per platform, allowing for flexibility in different environments.
  • Consider adding a flag or setting to enable/disable this feature per platform, in case some platforms have specific requirements or limitations.
  • To verify the fix, test the agent with a long-running terminal command and check if the user receives proactive status updates on the messaging platform.

Example

import time
import threading

# Assuming 'terminal_command' is the function that executes the terminal command
def execute_terminal_command(command):
    # Start a timer to monitor execution time
    start_time = time.time()
    def send_status_update():
        while True:
            elapsed_time = time.time() - start_time
            if elapsed_time > threshold:
                # Send status update to the user
                send_message("⏳ Still working... (running terminal command, {} min elapsed)".format(int(elapsed_time / 60)))
            time.sleep(update_interval)

    # Start the status update thread
    threading.Thread(target=send_status_update).start()
    # Execute the terminal command
    terminal_command(command)

Notes

The implementation details may vary depending on the specific programming language and framework used in the Hermes gateway agent. The example provided is a simplified illustration of the concept.

Recommendation

Apply a workaround by implementing the proactive status update mechanism, as it provides a more user-friendly experience and helps prevent the interrupt loop issue. This approach allows for a more robust and configurable solution that can be adjusted according to specific platform requirements.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING