From 41081d718c309acb10b018438fe905f6edd3697f Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 25 Mar 2026 17:34:20 -0700 Subject: [PATCH] fix(cli): prevent update crash in non-TTY environments (#3094) cmd_update calls input() unconditionally during config migration. In headless environments (Telegram gateway, systemd), there's no TTY, so input() throws EOFError and the update crashes. Guard with sys.stdin.isatty(), default to skipping the migration prompt when non-interactive. Salvaged from PR #2850 by devorun. Closes #2848. --- hermes_cli/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 1130b39a2..47bce4411 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -2812,7 +2812,10 @@ def cmd_update(args): print(f" ℹ️ {len(missing_config)} new config option(s) available") print() - response = input("Would you like to configure them now? [Y/n]: ").strip().lower() + if sys.stdin.isatty(): + response = input("Would you like to configure them now? [Y/n]: ").strip().lower() + else: + response = "n" if response in ('', 'y', 'yes'): print()