fix(setup): re-exec into fresh process when launching chat after setup#5848
Closed
bendusy wants to merge 1 commit into
Closed
fix(setup): re-exec into fresh process when launching chat after setup#5848bendusy wants to merge 1 commit into
bendusy wants to merge 1 commit into
Conversation
After the setup wizard's interactive prompts, stdin (fd 0) is left in a state that prompt_toolkit's asyncio selector cannot register, causing: OSError: [Errno 22] Invalid argument Replace the in-process cmd_chat() call with os.execvp(), matching the existing pattern in main.py (cmd_sessions browse). This gives prompt_toolkit a clean process with fresh stdin and event loop state.
Contributor
|
Thanks for the fix @bendusy! The approach here is exactly right. This is an automated hermes-sweeper review. After investigation, this PR can be closed — the identical fix landed on Evidence:
|
Collaborator
Collaborator
|
Likely duplicate of #6415 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_offer_launch_chat()callscmd_chat()in-process after the setup wizard's interactiveinput()prompts, but stdin (fd 0) is left in a state that prompt_toolkit's asyncio selector cannot register, causingOSError: [Errno 22] Invalid argumentos.execvp(), matching the existing pattern inmain.py(cmd_sessionsbrowse at L5175-5183)hermesbinary viashutil.which(), fall back topython -m hermes_cli.mainTraceback
Test plan
hermes setupon a fresh config (first-time quick setup path)hermesis not on PATH (fallback topython -m hermes_cli.main)