Skip to content

fix: auto-proceed installer warnings in headless mode#11564

Open
achimnol wants to merge 1 commit into
mainfrom
topic/fix-headless-wait-continue
Open

fix: auto-proceed installer warnings in headless mode#11564
achimnol wants to merge 1 commit into
mainfrom
topic/fix-headless-wait-continue

Conversation

@achimnol
Copy link
Copy Markdown
Member

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.
  • Root cause: SetupLog.wait_continue() blocks on an asyncio.Event that is only set by the Textual enter key 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.
  • Fix: short-circuit wait_continue() when self.app.is_headless is true, after printing the warning. This matches the existing headless special-casing in SetupLog.on_mount() / write() that already mirrors output to stdout.

The two call sites this unblocks are both in PackageContext.check_prerequisites() (context.py:537 for the LiveCD warning and context.py:551 for the WSL warning).

Test plan

  • Run ./backend.ai install --headless --non-interactive ... on a WSL host and confirm the installer proceeds past the WSL warning without manual input.
  • Run the same on a non-WSL/non-LiveCD host and confirm behavior is unchanged.
  • Run interactively (without --headless) and confirm the "Press Enter to continue" prompt still appears and still requires Enter.

`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.
@achimnol achimnol requested a review from a team as a code owner May 12, 2026 10:06
Copilot AI review requested due to automatic review settings May 12, 2026 10:06
@github-actions github-actions Bot added the size:XS ~10 LoC label May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@achimnol achimnol requested a review from devyubin May 12, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS ~10 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants