Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hermes_cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2839,6 +2839,11 @@ def run_setup_wizard(args):
def _offer_launch_chat():
"""Prompt the user to jump straight into chat after setup."""
print()
if os.environ.get("HERMES_SKIP_POST_SETUP_CHAT") == "1":
print_info(
"Skipping immediate launch into chat for this setup session."
)
return
if prompt_yes_no("Launch hermes chat now?", True):
from hermes_cli.main import cmd_chat
from types import SimpleNamespace
Expand Down
6 changes: 4 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,12 @@ run_setup_wizard() {

# Run hermes setup using the venv Python directly (no activation needed).
# Redirect stdin from /dev/tty so interactive prompts work when piped from curl.
# Skip the immediate handoff into chat: prompt_toolkit can fail on macOS
# when setup itself was started with stdin redirected from /dev/tty.
if [ "$USE_VENV" = true ]; then
"$INSTALL_DIR/venv/bin/python" -m hermes_cli.main setup < /dev/tty
HERMES_SKIP_POST_SETUP_CHAT=1 "$INSTALL_DIR/venv/bin/python" -m hermes_cli.main setup < /dev/tty
else
python -m hermes_cli.main setup < /dev/tty
HERMES_SKIP_POST_SETUP_CHAT=1 python -m hermes_cli.main setup < /dev/tty
fi
}

Expand Down
14 changes: 14 additions & 0 deletions tests/hermes_cli/test_setup_noninteractive.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,17 @@ def test_returning_user_terminal_menu_choice_dispatches_terminal_section(self, t

terminal_section.assert_called_once_with(config)
tts_section.assert_not_called()

def test_offer_launch_chat_skips_when_installer_requests_it(self, monkeypatch, capsys):
"""Installer-launched setup should be able to skip the in-process chat handoff."""
from hermes_cli import setup as setup_mod

monkeypatch.setenv("HERMES_SKIP_POST_SETUP_CHAT", "1")

with patch.object(
setup_mod, "prompt_yes_no", side_effect=AssertionError("prompt should not be called")
):
setup_mod._offer_launch_chat()

out = capsys.readouterr().out
assert "Skipping immediate launch into chat" in out