NousResearch/hermes-agent · error · RuntimeError
Provider has been unresponsive (no response received) for {_
Error message
Provider has been unresponsive (no response received) for {_streak} consecutive stale attempts — aborting this call to avoid an indefinite stall. Switch models or start a new session, then retry. What it means
Cross-turn stale-call circuit breaker (#58962): the agent tracks _consecutive_stale_streams, incremented on every stale kill and reset only when a call completes or the provider is swapped. Past HERMES_STREAM_STALE_GIVEUP (default 5) consecutive stale attempts, _check_stale_giveup() raises immediately — no network attempt, no stale-timeout wait — to stop a session wedged against an unresponsive provider from looping forever (observed 494 consecutive failures over days).
Source
Thrown at agent/chat_completion_helpers.py:386
logger.debug("stale status buffering failed", exc_info=True)
def _touch_stale_kill_activity(agent, elapsed: float) -> None:
try:
agent._touch_activity(
f"stale non-streaming call killed after {int(elapsed)}s"
)
except Exception:
logger.debug("stale activity touch failed", exc_info=True)
def _check_stale_giveup(agent) -> None:
"""Raise immediately when the consecutive-stale streak is past the
give-up threshold — no network attempt, no stale-timeout wait."""
_giveup = env_int("HERMES_STREAM_STALE_GIVEUP", 5)
_streak = _stale_streak(agent)
if _giveup > 0 and _streak >= _giveup:
raise RuntimeError(
"Provider has been unresponsive (no response received) for "
f"{_streak} consecutive stale attempts — aborting this call to "
"avoid an indefinite stall. Switch models or start a new "
"session, then retry."
)
def _derive_stream_stale_timeout(agent, api_kwargs: dict) -> float:
"""Stale-stream patience for a provider that is never a local endpoint.
Mirrors the main streaming path's derivation — provider config → env base
→ context-size scaling → reasoning-model floor — minus the local-endpoint
``float('inf')``/900s disable branch, which cannot apply to Bedrock (its
endpoint is always the AWS cloud). Factored so the Bedrock streaming
watchdog shares the exact same patience budget as the OpenAI/Anthropic
stale-stream detector below.
"""
_cfg_stale = get_provider_stale_timeout(agent.provider, agent.model)View on GitHub (pinned to c896c09c42)
Solutions
- Switch models/providers (`hermes model`) — swapping the provider resets the streak.
- Start a new session, then retry.
- Fix the underlying connectivity: check the provider status page, base_url, proxy.
- As a last resort for controlled environments, raise HERMES_STREAM_STALE_GIVEUP (or set 0 to disable) — understand this re-enables the indefinite-stall loop the breaker exists to stop.
Example fix
# temporary, diagnostics only export HERMES_STREAM_STALE_GIVEUP=10
Defensive patterns
Strategy: fallback
Validate before calling
from agent.chat_completion_helpers import _stale_streak
if _stale_streak(agent) >= 4: # one below default give-up of 5
switch_to_backup_provider_before_next_call() Try / catch
try:
response = call_model(...)
except RuntimeError as e:
if "consecutive stale attempts" in str(e):
agent.switch_model(backup_provider) # resets the streak
response = call_model(...) Prevention
- Configure a fallback model so `hermes model` swaps are one step.
- Watch for repeated stale kills and act on the first one, not the fifth.
- Do not raise HERMES_STREAM_STALE_GIVEUP in production — it re-enables the multi-day stall this breaker prevents.
When it happens
Trigger: Five (default) consecutive API calls each stalled with no response bytes until the stale detector killed them; the next call then aborts instantly at the pre-flight check in agent/chat_completion_helpers.py:386.
Common situations: Provider outage or hard-hanging endpoint; a proxy accepting connections but never responding; rate-limited endpoint that holds connections open; switching models resolves it because the streak measured the OLD provider.
Related errors
- Codex auxiliary Responses stream exceeded {float(total_timeo
- Auxiliary streamed call timed out after {self._total_ceiling
- video job {getattr(video, 'id', '?')} did not reach a termin
- Provider '{_explicit}' is set in config.yaml but no API key
- No LLM provider configured. Run `hermes model` to select a p
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/0fee8e5f32c2defc.
Report an issue: GitHub.