Skip to content

fix(cli): handle EOFError in sessions delete/prune confirmation prompts#3101

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-7d7ac769
Mar 26, 2026
Merged

fix(cli): handle EOFError in sessions delete/prune confirmation prompts#3101
teknium1 merged 1 commit intomainfrom
hermes/hermes-7d7ac769

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

hermes sessions delete and hermes sessions prune crash with EOFError when stdin is not a TTY (piped input, CI/CD, cron scripts).

Extracts a _confirm_prompt() helper that catches EOFError and KeyboardInterrupt, defaulting to cancel. Both call sites use it instead of duplicated try/except blocks.

Includes 2 new tests verifying both commands cancel gracefully on EOF.

Salvaged from PR #2622 by @dieutx (improved from duplicated try/except to shared helper). Closes #2565.

sessions delete and prune call input() for confirmation without
catching EOFError. When stdin isn't a TTY (piped input, CI/CD, cron),
input() throws EOFError and the command crashes.

Extract a _confirm_prompt() helper that handles EOFError and
KeyboardInterrupt, defaulting to cancel. Both call sites now use it.

Salvaged from PR #2622 by dieutx (improved from duplicated try/except
to shared helper). Closes #2565.
@teknium1 teknium1 merged commit bd43a43 into main Mar 26, 2026
4 checks passed
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…ts (NousResearch#3101)

sessions delete and prune call input() for confirmation without
catching EOFError. When stdin isn't a TTY (piped input, CI/CD, cron),
input() throws EOFError and the command crashes.

Extract a _confirm_prompt() helper that handles EOFError and
KeyboardInterrupt, defaulting to cancel. Both call sites now use it.

Salvaged from PR NousResearch#2622 by dieutx (improved from duplicated try/except
to shared helper). Closes NousResearch#2565.
StreamOfRon pushed a commit to StreamOfRon/hermes-agent that referenced this pull request Mar 29, 2026
…ts (NousResearch#3101)

sessions delete and prune call input() for confirmation without
catching EOFError. When stdin isn't a TTY (piped input, CI/CD, cron),
input() throws EOFError and the command crashes.

Extract a _confirm_prompt() helper that handles EOFError and
KeyboardInterrupt, defaulting to cancel. Both call sites now use it.

Salvaged from PR NousResearch#2622 by dieutx (improved from duplicated try/except
to shared helper). Closes NousResearch#2565.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant