mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
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.
This commit is contained in:
parent
281100e2df
commit
41081d718c
1 changed files with 4 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue