Skip to content

Fix non-TTY interactive chat launch handling#8420

Closed
pandego wants to merge 1 commit into
NousResearch:mainfrom
pandego:fix/5884-6393-tty-guard
Closed

Fix non-TTY interactive chat launch handling#8420
pandego wants to merge 1 commit into
NousResearch:mainfrom
pandego:fix/5884-6393-tty-guard

Conversation

@pandego
Copy link
Copy Markdown

@pandego pandego commented Apr 12, 2026

Summary

  • require a real TTY before starting interactive hermes chat
  • skip the post-setup hermes chat handoff entirely when stdin is non-interactive
  • preserve single-query hermes chat -q ... behavior for headless and piped use cases

Issues

Root cause

Interactive chat startup had a TTY requirement in the codebase, but the hermes chat path was not enforcing it before handing off to the prompt_toolkit TUI. Separately, setup could still offer and exec into chat after configuration even when stdin was not a TTY. In headless environments that led to invalid interactive launches and downstream stdin attachment crashes.

Fix

This keeps the change narrow and explicit:

  • interactive chat now fails fast with the existing TTY guard when no --query was provided
  • non-interactive single-query mode still bypasses the TTY requirement
  • setup now returns early from the post-setup launch helper when stdin is not interactive, so it neither prompts nor attempts to exec into chat

Validation

  • uv run --python 3.11 --extra dev python -m pytest tests/hermes_cli/test_setup_noninteractive.py -n 0
    • passed

@alt-glitch
Copy link
Copy Markdown
Collaborator

Related to #10558, #8842, #15720 (all addressing non-TTY chat launch). See also #8641 (parent issue). Consider consolidating.

@pandego
Copy link
Copy Markdown
Author

pandego commented May 4, 2026

closing this to reduce overlap. there are a few open PRs covering the same non-tty chat path

@pandego pandego closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: after install it, startup failed [Setup]: OSError: [Errno 22] Invalid argument:[prompt_toolkit crash]

2 participants