hermes - 💡(How to fix) Fix [Bug]: terminal tool hangs 50-65s when reusing existing session in CLI/TUI [1 pull requests]

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…

When the terminal tool reuses an existing session (no Creating new local environment log), it consistently hangs for 50–65 seconds before executing the command. The command itself completes in under 0.5s once it starts. This happens repeatedly throughout a session and is reproducible. Interestingly, when a new environment IS created (Creating new local environment logged), execution is fast and normal. Environment

Hermes version: 0.14.0 OS: Windows + WSL (Ubuntu) Provider: DeepSeek official API Model: deepseek-v4-flash

Steps to Reproduce

  1. Start a CLI/TUI session
  2. Run any terminal command (first call creates environment — fast)
  3. Continue the session and issue more terminal commands
  4. Observe subsequent terminal calls hanging 50–65s before executing

Evidence from agent.log Fast case (new environment created): 14:25:45,306 tools.terminal_tool: Creating new local environment for task default... 14:25:45,381 tools.terminal_tool: local environment ready for task default 14:25:49,018 agent.tool_executor: tool terminal completed (3.75s)

Slow cases (session reuse, no environment creation log): 14:26:04,070 API call #3 completed ← agent decides to call terminal ← 99s silence, no log at all 14:27:43,919 tool terminal completed (38.69s)

17:22:58,703 API call #38 completed ← ~61s silence 17:23:59,354 tool terminal completed (0.15s)

17:27:49,082 API call #103 completed ← ~61s silence 17:28:50,913 tool terminal completed (0.14s)

17:35:44,649 API call #90 completed ← ~51s silence 17:36:46,051 tool terminal completed (0.14s) The wait time clusters tightly around 50–65 seconds regardless of command content (observed across ping, which, echo, and other trivial commands).

Key Observations

  • Delay occurs only when reusing an existing terminal session, not on fresh environment creation
  • During the wait period, no logs are emitted — the hang is completely silent
  • Wait time is bimodal: occasionally ~10s (lucky), most often 50–65s (suggesting a fixed internal timeout)
  • The same agent running identical commands via Feishu channel completes in seconds — CLI-specific issue
  • Command execution time itself is unaffected (0.1–0.5s); all latency is in the pre-execution phase

Hypothesis The terminal session reuse path involves some form of synchronization (lock acquisition, state check, or readiness poll) with a ~60s timeout. When the first attempt fails or times out, execution proceeds after the full timeout elapses. The Feishu channel likely uses a different execution path that bypasses this. New environment creation (Creating new local environment) does not hit this path and is consistently fast.

Root Cause

When the terminal tool reuses an existing session (no Creating new local environment log), it consistently hangs for 50–65 seconds before executing the command. The command itself completes in under 0.5s once it starts. This happens repeatedly throughout a session and is reproducible. Interestingly, when a new environment IS created (Creating new local environment logged), execution is fast and normal. Environment

Hermes version: 0.14.0 OS: Windows + WSL (Ubuntu) Provider: DeepSeek official API Model: deepseek-v4-flash

Steps to Reproduce

  1. Start a CLI/TUI session
  2. Run any terminal command (first call creates environment — fast)
  3. Continue the session and issue more terminal commands
  4. Observe subsequent terminal calls hanging 50–65s before executing

Evidence from agent.log Fast case (new environment created): 14:25:45,306 tools.terminal_tool: Creating new local environment for task default... 14:25:45,381 tools.terminal_tool: local environment ready for task default 14:25:49,018 agent.tool_executor: tool terminal completed (3.75s)

Slow cases (session reuse, no environment creation log): 14:26:04,070 API call #3 completed ← agent decides to call terminal ← 99s silence, no log at all 14:27:43,919 tool terminal completed (38.69s)

17:22:58,703 API call #38 completed ← ~61s silence 17:23:59,354 tool terminal completed (0.15s)

17:27:49,082 API call #103 completed ← ~61s silence 17:28:50,913 tool terminal completed (0.14s)

17:35:44,649 API call #90 completed ← ~51s silence 17:36:46,051 tool terminal completed (0.14s) The wait time clusters tightly around 50–65 seconds regardless of command content (observed across ping, which, echo, and other trivial commands).

Key Observations

  • Delay occurs only when reusing an existing terminal session, not on fresh environment creation
  • During the wait period, no logs are emitted — the hang is completely silent
  • Wait time is bimodal: occasionally ~10s (lucky), most often 50–65s (suggesting a fixed internal timeout)
  • The same agent running identical commands via Feishu channel completes in seconds — CLI-specific issue
  • Command execution time itself is unaffected (0.1–0.5s); all latency is in the pre-execution phase

Hypothesis The terminal session reuse path involves some form of synchronization (lock acquisition, state check, or readiness poll) with a ~60s timeout. When the first attempt fails or times out, execution proceeds after the full timeout elapses. The Feishu channel likely uses a different execution path that bypasses this. New environment creation (Creating new local environment) does not hit this path and is consistently fast.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Description When the terminal tool reuses an existing session (no Creating new local environment log), it consistently hangs for 50–65 seconds before executing the command. The command itself completes in under 0.5s once it starts. This happens repeatedly throughout a session and is reproducible. Interestingly, when a new environment IS created (Creating new local environment logged), execution is fast and normal. Environment

Hermes version: 0.14.0 OS: Windows + WSL (Ubuntu) Provider: DeepSeek official API Model: deepseek-v4-flash

Steps to Reproduce

  1. Start a CLI/TUI session
  2. Run any terminal command (first call creates environment — fast)
  3. Continue the session and issue more terminal commands
  4. Observe subsequent terminal calls hanging 50–65s before executing

Evidence from agent.log Fast case (new environment created): 14:25:45,306 tools.terminal_tool: Creating new local environment for task default... 14:25:45,381 tools.terminal_tool: local environment ready for task default 14:25:49,018 agent.tool_executor: tool terminal completed (3.75s)

Slow cases (session reuse, no environment creation log): 14:26:04,070 API call #3 completed ← agent decides to call terminal ← 99s silence, no log at all 14:27:43,919 tool terminal completed (38.69s)

17:22:58,703 API call #38 completed ← ~61s silence 17:23:59,354 tool terminal completed (0.15s)

17:27:49,082 API call #103 completed ← ~61s silence 17:28:50,913 tool terminal completed (0.14s)

17:35:44,649 API call #90 completed ← ~51s silence 17:36:46,051 tool terminal completed (0.14s) The wait time clusters tightly around 50–65 seconds regardless of command content (observed across ping, which, echo, and other trivial commands).

Key Observations

  • Delay occurs only when reusing an existing terminal session, not on fresh environment creation
  • During the wait period, no logs are emitted — the hang is completely silent
  • Wait time is bimodal: occasionally ~10s (lucky), most often 50–65s (suggesting a fixed internal timeout)
  • The same agent running identical commands via Feishu channel completes in seconds — CLI-specific issue
  • Command execution time itself is unaffected (0.1–0.5s); all latency is in the pre-execution phase

Hypothesis The terminal session reuse path involves some form of synchronization (lock acquisition, state check, or readiness poll) with a ~60s timeout. When the first attempt fails or times out, execution proceeds after the full timeout elapses. The Feishu channel likely uses a different execution path that bypasses this. New environment creation (Creating new local environment) does not hit this path and is consistently fast.

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