Skip to content

fix(installer): point the Windows banner at /agents, not /hub - #4294

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:claude/install-ps1-banner-agents
Sep 25, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:claude/install-ps1-banner-agents

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

The Windows one-line installer's closing banner told new users to type /hub in the terminal UI, which has no such command, so their very first action was sent to the model as a question. It now says /agents, matching the macOS/Linux installer, and a test checks every /command either installer prints in its closing banner against the TUI's command list, so the banners can't drift again.

Test plan

  • ~/.cache/gaia-dev/venv/bin/python -m pytest tests/unit/installer/test_install_scripts_terminal_hub.py -q -k banner_slash: the ps1 case fails on main (/hub), and both cases pass with the fix
  • ~/.cache/gaia-dev/venv/bin/python -m pytest tests/unit/installer/test_install_scripts_terminal_hub.py -q: all pass
  • black and isort are clean on the changed test file

Fixes #4231

The Windows installer's last line told new users to type /hub, which the terminal UI does not have, so their first command went to the model as a question. It now says /agents, matching install.sh, and a test checks every /command in both closing banners against the TUI's command list.

Fixes amd#4231
@github-actions github-actions Bot added installer Installer changes tests Test changes labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Approve

The Windows installer's closing banner told brand-new users to type a command the terminal UI doesn't have, so their first keystroke went to the model as a question instead of doing anything. This fixes the wording to match the macOS/Linux installer and adds a test that cross-checks every slash command either installer prints against the list the terminal UI actually defines — so the two can't drift apart again.

I reproduced the test's logic against this branch: both installers now advertise only /agents, and that command really is defined in the terminal UI. The same check fails for the old wording, so the guard is real and not vacuous.

Real-world evidence

No evidence bundle was produced for this PR, and none is expected: the change is one line of text in a Windows PowerShell installer that this Linux CI lane can't run. The verdict rests on static review plus the new test, which I re-ran by hand here. The PR's test plan reports the pytest run passing on the fix and failing on main — worth a reviewer with a Windows box eyeballing the printed banner once, but nothing blocking.

🔍 Technical details

Verification performed

  • installer/scripts/install.ps1:405 now prints /agents; paletteCommands in tui/internal/ui/chat/palette.go:32 defines /agents and has no /hub, confirming the bug and the fix.
  • Re-implemented _tui_commands / _banner_commands from tests/unit/installer/test_install_scripts_terminal_hub.py:27-45 in a scratch script against this checkout. Parsed TUI commands: /agents /bypass /clear /cost /help /memory /model /provider /setup /slack. Extracted banner commands: {/agents} for both sh and ps1, unknown empty. Both assertions hold.
  • Checked the extraction boundaries hold on the current sources: the \n}\n terminator lands on each function's closing brace (PowerShell's inner } else { is indented, and the shell function's if/fi has no braces), and the URLs in both banners (https://amd-gaia.ai, github.com/amd/gaia/issues) are correctly excluded by the negative lookbehind rather than being picked up as commands.
  • Grepped the tree for surviving /hub command references: remaining hits are website route docs (website/README.md, workers/website-router/README.md) and a historical plan doc (docs/plans/tui-user-journey.md:1047) — none are user-facing instructions to type /hub, so no companion doc update is owed.

🟢 Nit — the command regexes only accept lowercase letters and hyphens (tests/unit/installer/test_install_scripts_terminal_hub.py:35 and :45). A future command containing a digit or capital (/model2, /OAuth) would be invisible to both sides of the comparison: an unknown one in a banner would slip through silently rather than failing the test. Widening both character classes keeps the guard airtight as the palette grows. Low priority — nothing in paletteCommands needs it today.

Strengths

  • The test attacks the actual failure mode rather than the symptom: it pins the banner to the TUI's own command list, so this class of bug can't come back through a different string.
  • It follows the file's established two-layer philosophy and reuses the existing sh_text / ps1_text fixtures and REPO_ROOT anchoring instead of inventing new plumbing.
  • Parameterizing over sh and ps1 means the macOS/Linux banner — which was already correct — is now locked in too, not just the one that regressed.
  • Both helpers assert on their own parse results (assert block, assert commands, assert banner), so a refactor that breaks the parsing fails loudly instead of degrading into a test that checks nothing.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 25, 2026
Merged via the queue into amd:main with commit 099d1a4 Sep 25, 2026
38 checks passed
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 26, 2026
… terminal (amd#4298)

Stacked on amd#4294. Merge that first.

The documented `irm https://amd-gaia.ai/install.ps1 | iex` runs the
installer inside the user's own PowerShell session. Any failure's `exit
1` closed their window and took the "Fix:" hint with it, and even a
successful run left their session with `$ErrorActionPreference = "Stop"`
and custom functions shadowing the built-in
`Write-Error`/`Write-Warning`. Now the script runs in its own scope and
fails with `throw`, so the error and its hint stay on screen and the
session is left as it was. Running it with `pwsh -File install.ps1`
still exits 1 on failure.

It also stops shadowing `Write-Error` for uv's own `irm | iex`
installer, which runs inside this script's scope.

## Test plan
- [x] With pwsh 7.6.6 on macOS, `pytest
tests/unit/installer/test_install_scripts_terminal_hub.py -q` passed 47,
with 1 skip (wget not installed). The script's real non-Windows failure
path covers these checks:
- [x] After the `iex` run fails, the session survives,
`$ErrorActionPreference` is `Continue`, `Write-Error` and
`Write-Warning` resolve to the cmdlets, and no installer function is
left behind. This failed on the base branch because the process exited.
- [x] `pwsh -File install.ps1` exits non-zero and still prints the
reason.
- [x] A static check finds no `exit` left in the script (the base branch
has 11) and confirms the script still parses.
- [ ] A real Windows `irm | iex` install, both one that succeeds and one
that fails partway (for example with the network off before the hub
download)

Fixes amd#4224

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installer Installer changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(installer): install.ps1 tells users to type /hub, which doesn't exist

2 participants