bug: terminal() tool hard-caps foreground timeout at 600s, needs 1200+ #65

Closed
opened 2026-05-13 20:06:03 +00:00 by Mark · 1 comment
Owner

Description

terminal_tool.py line 105-108 hardcodes FOREGROUND_MAX_TIMEOUT = 600 with an env var override (TERMINAL_MAX_FOREGROUND_TIMEOUT). The tool rejects any foreground timeout= parameter above 600s.

FOREGROUND_MAX_TIMEOUT = _safe_parse_import_env(
    "TERMINAL_MAX_FOREGROUND_TIMEOUT",
    600,   # hardcoded default
    int,
)

GSD pipelines, provider calls, and long-running analysis commands routinely exceed 600s. The 600s cap forces either:

  • Background mode with polling (extra complexity)
  • Splitting work into artificial chunks
  • Running commands outside the hermes tool framework

Impact

  • GSD runs with multiple slices routinely hit this wall
  • Pipelines forced into background+notify pattern when a simple foreground call with generous timeout would suffice
  • No config.yaml setting exists to adjust this — only an env var, which is invisible and fragile across deployments

Request

  1. Raise the default from 600 to 1200 (600 is clearly too tight for any multi-step pipeline)
  2. Better: make it configurable via config.yaml under the terminal: section instead of a source-code env var

Location

~/.hermes/hermes-agent/tools/terminal_tool.py lines 105-111

## Description `terminal_tool.py` line 105-108 hardcodes `FOREGROUND_MAX_TIMEOUT = 600` with an env var override (`TERMINAL_MAX_FOREGROUND_TIMEOUT`). The tool rejects any foreground `timeout=` parameter above 600s. ```python FOREGROUND_MAX_TIMEOUT = _safe_parse_import_env( "TERMINAL_MAX_FOREGROUND_TIMEOUT", 600, # hardcoded default int, ) ``` GSD pipelines, provider calls, and long-running analysis commands routinely exceed 600s. The 600s cap forces either: - Background mode with polling (extra complexity) - Splitting work into artificial chunks - Running commands outside the hermes tool framework ## Impact - GSD runs with multiple slices routinely hit this wall - Pipelines forced into background+notify pattern when a simple foreground call with generous timeout would suffice - No config.yaml setting exists to adjust this — only an env var, which is invisible and fragile across deployments ## Request 1. **Raise the default** from 600 to **1200** (600 is clearly too tight for any multi-step pipeline) 2. **Better: make it configurable via config.yaml** under the `terminal:` section instead of a source-code env var ## Location `~/.hermes/hermes-agent/tools/terminal_tool.py` lines 105-111
Author
Owner

Fix Applied

Added TERMINAL_MAX_FOREGROUND_TIMEOUT=1200 to ~/.hermes/.env.

Hermes loads .env via load_hermes_dotenv() before tool modules are imported, so this env var is picked up at import time by _safe_parse_import_env() in terminal_tool.py.

Test

Before fix (current session, still at 600 cap):

terminal(timeout=1200) -> Error: "Foreground timeout 1200s exceeds the maximum of 600s."

After next process restart, the env var will be read and the cap will be 1200.

Resolution

  • Immediate fix: env var in .env — survives agent restarts, no code change needed
  • Long-term fix (still worth doing): make this configurable via config.yaml under the terminal: section so it's discoverable, not an invisible env var. Accepting close on the env var workaround; reopen if you want the config.yaml route.
## Fix Applied Added `TERMINAL_MAX_FOREGROUND_TIMEOUT=1200` to `~/.hermes/.env`. Hermes loads `.env` via `load_hermes_dotenv()` before tool modules are imported, so this env var is picked up at import time by `_safe_parse_import_env()` in `terminal_tool.py`. ## Test Before fix (current session, still at 600 cap): ``` terminal(timeout=1200) -> Error: "Foreground timeout 1200s exceeds the maximum of 600s." ``` After next process restart, the env var will be read and the cap will be 1200. ## Resolution - **Immediate fix**: env var in `.env` — survives agent restarts, no code change needed - **Long-term fix** (still worth doing): make this configurable via `config.yaml` under the `terminal:` section so it's discoverable, not an invisible env var. Accepting close on the env var workaround; reopen if you want the config.yaml route.
Mark closed this issue 2026-05-13 20:11:38 +00:00
Sign in to join this conversation.
No description provided.