Skip to content

fix(install): probe /dev/tty by opening it, not bare existence - #16943

Closed
ekkoitac wants to merge 1 commit into
NousResearch:mainfrom
ekkoitac:fix/issue-16746
Closed

ekkoitac wants to merge 1 commit into
NousResearch:mainfrom
ekkoitac:fix/issue-16746

Conversation

@ekkoitac

Copy link
Copy Markdown
Contributor

Summary

The Hermes installer (scripts/install.sh) uses [ -e /dev/tty ] to detect whether a terminal is available and skip the interactive setup wizard in Docker/CI environments. However, in Docker builds, /dev/tty typically exists as a device node (-e returns true) but cannot be opened (returns ENXIO: No such device or address), causing the wizard to run and crash.

This fix replaces the bare existence check with an actual open attempt:

# Before (unreliable in Docker)
if ! [ -e /dev/tty ]; then

# After (actually tests if /dev/tty is usable)
if ! { exec 3</dev/tty; } 2>/dev/null; then
    log_info "Setup wizard skipped (no terminal available)."
    return 0
fi
exec 3</&-

Changes

  • scripts/install.sh: Changed /dev/tty check from file existence to actual open attempt, matching the behavior already documented in the comment above it.

Testing

  • Verified the script logic correctly detects unusable /dev/tty in containerized environments
  • Existing tests pass

Fixes #16746

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/docker Docker image, Compose, packaging duplicate This issue or pull request already exists labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Likely duplicate of #16750 — both fix the same /dev/tty probe issue in install.sh for Docker environments (fixes #16746).

@teknium1

Copy link
Copy Markdown
Collaborator

Closing as superseded by #17024.

Triage notes (high confidence):
Identical-titled PR #17024 was merged 2026-04-28; origin/main scripts/install.sh:834,1705 already probes /dev/tty by opening it via '(: </dev/tty) 2>/dev/null'.

Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen.

(Bulk-closed during a CLI PR triage sweep.)

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

Labels

area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists 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]: Installer setup wizard fails in Docker builds: [ -e /dev/tty ] check unreliable

3 participants