Skip to content

fix(B-0832): nmtui auto-relaunch loop on no-internet — Esc to refresh without breaking install (operator 2026-05-26)#5378

Merged
AceHack merged 2 commits into
mainfrom
fix-b0832-nmtui-auto-relaunch-on-no-internet-aaron-2026-05-26
May 27, 2026
Merged

fix(B-0832): nmtui auto-relaunch loop on no-internet — Esc to refresh without breaking install (operator 2026-05-26)#5378
AceHack merged 2 commits into
mainfrom
fix-b0832-nmtui-auto-relaunch-on-no-internet-aaron-2026-05-26

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 27, 2026

What

Operator 2026-05-26 during 3rd USB physical test: "i want to be able to refresh the network withing breaking the script".

Old behavior: nmtui launched ONCE; if no internet on exit → drop_to_shell (broke install flow). Esc was destructive.

New behavior: loop nmtui until `has_internet` OR operator explicit 's' for shell. Esc out refreshes; 's' escape-hatch preserved.

Operator flow

  • Esc out of nmtui without connecting → nmtui re-launches with fresh wifi scan (operator can refresh as needed)
  • Connect successfully → script continues to zeta-install
  • Need shell access → press 's' at the post-attempt prompt within 10s

`NMTUI_ATTEMPTS` counter tracks session count + logs in success message ("wifi ok (after N nmtui session(s))").

Composes with

  • B-0832 (nmtui WiFi rescan empirical anchor row)
  • `.claude/rules/non-coercion-invariant.md` HC-8 (operator agency preserved via 's' escape-hatch)
  • `.claude/rules/substrate-or-it-didnt-happen.md` (substrate-honest UX matches operator's Esc-to-refresh expectation)

🤖 Generated with Claude Code

…ui re-launches (refresh-friendly UX) instead of breaking install flow (operator 2026-05-26)

Operator 2026-05-26 substrate-engineering ask during 3rd USB physical
test: 'i want to be able to refresh the network withing breaking the
script'.

Old behavior: launch nmtui ONCE; if no internet on exit → drop_to_shell.
That broke the install flow when operator hit Esc to refresh the wifi
scan (empirical 2026-05-26 1st USB physical-test session — B-0832
nmtui WiFi rescan empirical anchor).

New behavior: loop nmtui until either:
- has_internet succeeds → continue install
- operator presses 's' within 10s → drop to shell (escape hatch)

Operator flow:
- Esc out of nmtui without connecting → nmtui re-launches with fresh
  wifi scan
- Connect successfully → script continues to zeta-install
- Need shell access → press 's' at the post-attempt prompt

Counter NMTUI_ATTEMPTS tracks session count + logs in success message
so operator sees how many tries it took.

Composes with .claude/rules/non-coercion-invariant.md HC-8: operator
agency preserved (drop-to-shell available; choice is operator-driven).
Composes with .claude/rules/substrate-or-it-didnt-happen.md: substrate-
honest UX matches operator's real-world Esc-to-refresh expectation.

Bash syntax verified clean via bash -n.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copilot AI review requested due to automatic review settings May 27, 2026 02:01
@AceHack AceHack enabled auto-merge (squash) May 27, 2026 02:01
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown

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

This PR updates the first-boot USB NixOS installer flow to prevent an accidental “Esc out of nmtui → drop to shell” path when Wi‑Fi isn’t connected yet, by auto-relaunching nmtui until internet is detected (or the operator explicitly requests a shell).

Changes:

  • Loop nmtui sessions until has_internet succeeds, tracking attempts via NMTUI_ATTEMPTS.
  • Add an explicit post-attempt prompt allowing operator-controlled escape to shell via s (otherwise relaunch nmtui to refresh scans).
  • Improve on-screen guidance explaining the Esc-to-refresh behavior.

Comment thread full-ai-cluster/usb-nixos-installer/zeta-first-boot.sh
…ded 10s); mirrors ROLE_PROMPT_SECS env-override pattern + adds -r to new read

Copilot finding on PR #5378 line 160:
> The retry prompt hard-codes the timeout value ('within 10s' in the
> message and 'read ... -t 10' in code). This can drift if the timeout
> is adjusted later. Consider introducing a single NMTUI_RETRY_PROMPT_SECS
> (similar to ROLE_PROMPT_SECS) and use it in both the message + read.

Substrate-honest finding. Fix:

1. Add NMTUI_RETRY_PROMPT_SECS=${NMTUI_RETRY_PROMPT_SECS:-10} env-
   overridable var near ROLE_PROMPT_SECS (consistent pattern)
2. Use $NMTUI_RETRY_PROMPT_SECS in the user-facing 'within Xs' message
3. Use 'read -r -t "${NMTUI_RETRY_PROMPT_SECS}"' in the actual read
4. Added -r flag to the read (ShellCheck Information-level diagnostic
   on the read I added in the prior commit; hygiene improvement)

Now operator can tune via /etc/zeta-firstboot.conf:
  echo 'NMTUI_RETRY_PROMPT_SECS=30' >> /etc/zeta-firstboot.conf

Bash syntax verified clean via bash -n.
auto-merge was automatically disabled May 27, 2026 02:08

Pull Request is not mergeable

@AceHack AceHack merged commit fb46766 into main May 27, 2026
29 checks passed
@AceHack AceHack deleted the fix-b0832-nmtui-auto-relaunch-on-no-internet-aaron-2026-05-26 branch May 27, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants