hermes-agent/hermes_cli
Teknium 19fb03a93c
Port from QwenLM/qwen-code#8602: cap a streaming response's total lifetime
The stale-stream detector only bounds the gap BETWEEN chunks and resets on
every chunk, so a drip-fed stream — a gateway trickling keep-alive-shaped
chunks, or a model crawling through one runaway generation for hours —
defeats it indefinitely: the turn never completes and the session sits
silent until an outer timeout (if any) kills it.

Adds a total wall-clock lifetime cap for one streaming response attempt:

- agent.stream_max_lifetime (config.yaml) / HERMES_STREAM_MAX_LIFETIME,
  default 1800s, 0 disables. Never fires before the effective stale-stream
  timeout, so it cannot preempt reasoning-model patience floors.
- Main OpenAI/Anthropic poll loop: tripping the cap kills the connection
  exactly like a stale kill (attempt cancelled, request client closed),
  counts in the #58962 cross-turn stale-streak breaker, and lets the
  bounded retry loop / partial-stub continuation recover.
- Bedrock poll loop (sibling site): same cap wired into the existing event
  watchdog, surfacing a distinct TimeoutError.

Tests: drip-fed stream (events flowing every 50ms so the stale detector can
never fire) is killed at the cap and bumps the streak — verified to hang
without the fix (sabotage run timed out); 0-disable; config/env resolution
precedence. Docs: configuration.md timeout table + env var reference.
2026-08-06 18:40:09 -07:00
..
dashboard_auth
observability Merge updated client resource metrics into active-install metrics 2026-08-04 15:10:41 -07:00
proxy
subcommands
web_routers refactor(utils): move mode+owner preservation into atomic_write_text 2026-08-06 05:00:17 +05:30
__init__.py chore: release v0.20.0 (2026.8.3) 2026-08-03 09:57:23 -07:00
_early_recovery.py
_parser.py
_scan_venv_blockers.py
_startup_fast.py
_subprocess_compat.py chore: suppress windows-footgun false positive on gated killpg 2026-08-04 17:33:36 -07:00
active_sessions.py
agent_import.py
approval_mode.py
approvals_suggest.py
auth.py feat(providers): add Actual Computer inference provider 2026-08-05 14:08:32 -07:00
auth_commands.py
azure_detect.py
backup.py fix(backup): serialize and atomically publish snapshots 2026-08-03 23:48:55 +05:30
bang_shell.py
banner.py
blueprint_cmd.py
browser_connect.py
build_info.py
bundles.py
callbacks.py fix(approval): classify CLI/TUI approval timeouts separately from explicit denials 2026-08-02 20:21:59 -07:00
checkpoints.py
claw.py
cli_agent_setup_mixin.py fix(cli): persist YOLO mode across --resume 2026-08-02 20:30:06 -07:00
cli_billing_mixin.py
cli_commands_mixin.py feat: /refine — run the memory/skill self-improvement review on demand 2026-08-05 22:40:51 -07:00
cli_output.py
clipboard.py
codex_models.py
codex_runtime_plugin_migration.py
codex_runtime_switch.py
colors.py
commands.py feat: /refine — run the memory/skill self-improvement review on demand 2026-08-05 22:40:51 -07:00
completion.py
config.py
config_defaults.py Port from QwenLM/qwen-code#8602: cap a streaming response's total lifetime 2026-08-06 18:40:09 -07:00
config_migrations.py
console_engine.py fix(console): handle string SystemExit code in _capture_output 2026-08-05 11:48:03 +05:30
container_boot.py
context_switch_guard.py
copilot_auth.py test: harden cold-start regression tests + debug-log the env-var skip 2026-08-03 21:16:09 +05:30
credential_lifecycle.py
cron.py
curator.py
curses_ui.py
dashboard_procs.py
dashboard_register.py
debug.py fix(debug): say where a client-side log lives instead of "(file not found)" (#78687) 2026-08-04 11:53:32 -06:00
default_soul.py
dep_ensure.py
diagnostics_upload.py
dingtalk_auth.py
doctor.py feat(providers): add Actual Computer inference provider 2026-08-05 14:08:32 -07:00
dump.py feat(gateway): session activity watchdog, stall notify, compress timeout (#72424) 2026-08-02 16:16:36 -07:00
env_loader.py fix(env): make config.yaml authoritative for terminal.backend (#29186) 2026-08-02 18:21:58 -07:00
fallback_cmd.py
fallback_config.py
focus_view.py
gateway.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
gateway_enroll.py
gateway_windows.py
goals.py feat(goals): quality gates — deterministic commands that must pass before /goal completes 2026-08-05 22:32:39 -07:00
gui_uninstall.py feat(desktop): register a Linux launcher entry for `hermes desktop` 2026-08-05 11:47:05 -04:00
heartbeat.py feat: /heartbeat — recurring session re-entry prompt fired when idle 2026-08-05 22:32:55 -07:00
hooks.py feat(hooks): outbound webhooks — push signed lifecycle events to external HTTP endpoints 2026-08-02 15:01:11 -07:00
init_command.py
input_sanitize.py
inventory.py
journey.py
kanban.py
kanban_db.py fix(tui): avoid writable Kanban opens on empty polls 2026-08-03 20:40:28 +05:30
kanban_decompose.py
kanban_diagnostics.py
kanban_specify.py
kanban_swarm.py
lifecycle.py
linux_desktop_entry.py feat(desktop): register a Linux launcher entry for `hermes desktop` 2026-08-05 11:47:05 -04:00
logs.py
main.py feat(update): emit an action-scoped terminal receipt from hermes update 2026-08-05 10:34:18 -06:00
managed_scope.py
managed_uv.py
mcp_catalog.py fix(catalog): validate http+api_key manifests declare the header's env key 2026-08-03 22:55:36 +05:30
mcp_config.py
mcp_picker.py
mcp_security.py
mcp_startup.py
mem_trim.py
memory_oauth.py
memory_setup.py
middleware.py
migrate.py
moa_cmd.py
moa_config.py
model_catalog.py
model_cost_guard.py
model_normalize.py fix(models): a model id missing its vendor prefix says so instead of 404ing (#78856) 2026-08-04 19:35:57 +00:00
model_search.py
model_setup_flows.py
model_switch.py fix(model-switch): treat models dict as metadata, not allowlist 2026-08-04 08:52:31 -07:00
models.py feat(providers): add Actual Computer inference provider 2026-08-05 14:08:32 -07:00
nous_account.py
nous_auth_keepalive.py
nous_billing.py
nous_subscription.py
npm_engine.py
onepassword_secrets_cli.py
oneshot.py
pairing.py
partial_compress.py
pets.py
platforms.py
plugins.py
plugins_cmd.py
portal_cli.py
profile_describer.py
profile_distribution.py refactor(utils): move mode+owner preservation into atomic_write_text 2026-08-06 05:00:17 +05:30
profiles.py refactor: trim verbose comments + drop redundant default_flow_style kwarg 2026-08-05 11:59:33 +05:30
projects_cmd.py
projects_db.py
prompt_size.py fix(prompt_size): search volatile tier for skills block after the stable->volatile move 2026-08-03 23:23:39 +05:30
prompt_stash.py
provider_catalog.py
providers.py feat(providers): add Actual Computer inference provider 2026-08-05 14:08:32 -07:00
proxy_cli.py
psutil_android.py
pt_input_extras.py
pty_bridge.py
pty_session.py
relaunch.py
route_identity.py
runtime_provider.py fix: adapt Actual provider salvage to current main 2026-08-05 14:08:32 -07:00
secret_prompt.py
secrets_cli.py
security_advisories.py
security_audit.py
security_audit_startup.py
send_cmd.py feat(gateway): simplex channel enumeration + show configured platforms in hermes send --list 2026-08-02 15:08:45 -07:00
service_manager.py
session_export.py
session_export_html.py
session_export_md.py
session_filters.py
session_listing.py
session_recap.py
session_recovery.py fix(state): deduplicate session system prompts 2026-08-03 20:37:17 +05:30
sessions_cmd.py fix(cli): back up state.db before clean-markers writes by default 2026-08-04 11:26:15 +05:30
setup.py
setup_hidden_env.py
setup_whatsapp_cloud.py
skills_config.py
skills_hub.py
skin_cmd.py refactor: trim verbose comments + drop redundant default_flow_style kwarg 2026-08-05 11:59:33 +05:30
skin_engine.py
slack_cli.py
slash_exec.py
sqlite_runtime.py
sqlite_safe_read.py
sqlite_util.py
status.py chore: round-2 review nits (re-review #9) 2026-08-02 16:16:36 -07:00
stdio.py
suggestions_cmd.py
telegram_managed_bot.py
timefmt.py chore: round-2 review nits (re-review #9) 2026-08-02 16:16:36 -07:00
timeouts.py
tips.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
tools_config.py fix(tools): reuse subscription features for toolset listing 2026-08-03 16:07:16 +05:30
toolset_validation.py
uninstall.py refactor(utils): move mode+owner preservation into atomic_write_text 2026-08-06 05:00:17 +05:30
update_cmd.py feat(update): emit an action-scoped terminal receipt from hermes update 2026-08-05 10:34:18 -06:00
update_lock.py
urllib_security.py
vercel_auth.py
voice.py
web_deps.py
web_git.py
web_models.py feat(profiles): REST export/import + extra_files overlay hook 2026-08-04 12:07:29 -06:00
web_server.py feat(update): emit an action-scoped terminal receipt from hermes update 2026-08-05 10:34:18 -06:00
webhook.py
win_pty_bridge.py
windows_ssh_runtime.py
write_approval_commands.py
xai_retirement.py refactor(utils): move mode+owner preservation into atomic_write_text 2026-08-06 05:00:17 +05:30