fix: auto-proceed installer warnings in headless mode#11564
Open
achimnol wants to merge 1 commit into
Open
Conversation
`SetupLog.wait_continue()` previously blocked on an asyncio Event that could only be set by the Textual `enter` key binding. When the installer runs with `--headless`, Textual has no terminal-attached UI to receive keystrokes, so the WSL/LiveCD environment warning prompt would hang forever waiting for an Enter press that never arrives. Detect headless mode and auto-continue after printing the warning so `./backend.ai install --headless --non-interactive ...` proceeds without human input.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a hang in the Textual-based installer when running backend.ai install with --headless by ensuring environment-warning prompts don’t wait for an Enter keypress that cannot be delivered in headless mode.
Changes:
- Short-circuit
SetupLog.wait_continue()in headless mode to auto-proceed after emitting a note. - Add a changelog entry documenting the fix for WSL/LiveCD warning hangs under
--headless.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/ai/backend/install/widgets.py |
Prevents wait_continue() from blocking forever in headless runs by returning early. |
changes/11564.fix.md |
Documents the headless installer hang fix in the project changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
./backend.ai install --headless --non-interactive ...hangs after the WSL (or LiveCD) environment warning is printed: it waits forever on a "Press Enter to continue" prompt that no terminal keystroke can satisfy.SetupLog.wait_continue()blocks on anasyncio.Eventthat is only set by the Textualenterkey binding (widgets.py). In headless mode Textual is not attached to the terminal, so keystrokes typed in the shell never reach the binding — the event is never set.wait_continue()whenself.app.is_headlessis true, after printing the warning. This matches the existing headless special-casing inSetupLog.on_mount()/write()that already mirrors output to stdout.The two call sites this unblocks are both in
PackageContext.check_prerequisites()(context.py:537for the LiveCD warning andcontext.py:551for the WSL warning).Test plan
./backend.ai install --headless --non-interactive ...on a WSL host and confirm the installer proceeds past the WSL warning without manual input.--headless) and confirm the "Press Enter to continue" prompt still appears and still requires Enter.