Skip to content

fix: relaunch chat in a fresh process when setup leaves stdin dirty - #6415

Closed
who96 wants to merge 1 commit into
NousResearch:mainfrom
who96:fix/setup-wizard-stdin-crash
Closed

fix: relaunch chat in a fresh process when setup leaves stdin dirty#6415
who96 wants to merge 1 commit into
NousResearch:mainfrom
who96:fix/setup-wizard-stdin-crash

Conversation

@who96

@who96 who96 commented Apr 9, 2026

Copy link
Copy Markdown

Summary

What did NOT change

  • the normal in-process cmd_chat(...) path still runs when chat starts cleanly
  • no chat flags, provider selection behavior, or setup flow prompts were changed

User-visible changes

  • after setup finishes, choosing Launch hermes chat now? no longer crashes on the known stdin-selector failure path
  • when the selector registration bug is hit, Hermes prints Starting chat in a fresh session... and relaunches chat

Compatibility / Security impact

  • no API, config schema, or database changes
  • no new permissions or network behavior
  • behavior change is limited to the setup-to-chat handoff when the known OSError(22, ...) path is hit

Test plan

  • pytest tests/hermes_cli/test_setup.py -k offer_launch_chat_reexecs_after_oserror -q
  • pytest tests/hermes_cli/test_setup.py -k offer_launch_chat_reraises_unrelated_oserror -q
  • pytest tests/hermes_cli/test_setup.py -k 'binary_missing or binary_exec_fails' -q
  • pytest tests/hermes_cli/test_setup.py -q
  • pytest tests/ -v

Evidence / Actual results

  • targeted setup suite: 14 passed in 2.02s
  • focused fallback tests: 4 passed in 1.35s
  • full suite on this branch: 28 failed, 9355 passed, 31 skipped, 1 xpassed
  • full suite on clean origin/main baseline: 28 failed, 9351 passed, 31 skipped, 1 xpassed
  • real TTY smoke test in isolated temp profile: setup wizard reached Launch hermes chat now?, accepted y, and launched chat TUI without the selector crash
  • verification profile path: /tmp/hermes-pr1-hv.XOBmql

Human verification

Completed in a real TTY against an isolated temp profile:

  • HERMES_HOME=/tmp/hermes-pr1-hv.XOBmql
  • ran hermes setup in the temp venv
  • skipped the OpenClaw import prompt to avoid using existing user state
  • reached Launch hermes chat now?
  • answered y
  • Hermes launched the chat TUI and showed Welcome to Hermes Agent! Type your message or /help for commands.

What was verified:

  • the setup-to-chat handoff completes in a fresh session
  • the selector/stdin crash does not occur on the launch path

What was not verified:

  • sending a chat message through a live provider in this temp profile
  • provider-auth setup was not completed in the isolated run

Risks / rollback

  • risk is limited to the setup handoff path; unrelated OSErrors are re-raised instead of triggering a relaunch
  • rollback is a simple revert of hermes_cli/setup.py and tests/hermes_cli/test_setup.py

@alt-glitch alt-glitch added comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working labels Apr 30, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as stale — the code path this addresses no longer exists on main.

Triage notes (high confidence):
PR patches _offer_launch_chat() in hermes_cli/setup.py, but that function no longer exists on origin/main (git grep '_offer_launch_chat|Launch hermes chat|offer_launch' returns no hits) — surrounding code was restructured.

If this PR's intent is still relevant against the current code, please rebase or open a fresh PR.

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

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.

[Setup]: OSError: [Errno 22] Invalid argument:[prompt_toolkit crash]

3 participants