Skip to content

fix(install): bundle the Agent UI build in the frozen gaia - #6948

Merged
kovtcharov-amd merged 3 commits into
mainfrom
kalin/frozen-core-webui
Nov 7, 2026
Merged

kovtcharov-amd merged 3 commits into
mainfrom
kalin/frozen-core-webui

Conversation

@kovtcharov-amd

@kovtcharov-amd kovtcharov-amd commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Since v0.26.0-rc6 the frozen gaia shipped without the web UI build, so gaia chat --ui served only its "This is the GAIA backend API" placeholder. Anyone opening the Agent UI in a browser or on a phone over the tunnel got no app, and every desktop journey row (win-agent-ui-exe, win-setup-ui, the .deb, AppImage and dmg rows) timed out waiting for the setup screen. Now the core build builds the UI first, the freeze bundles it and refuses to build without it, and the smoke test fails if / isn't the app. When setup fails, the journey rows now also upload Playwright's screenshot, trace and report.

#6946 doesn't fix this one: it changes gaia init's agent check, and this failure is the missing UI files.

Test plan

  • pytest tests/unit/installer/test_core_freeze_webui.py tests/unit/installer/test_installer_headless.py tests/unit/installer/test_install_scripts_terminal_hub.py tests/unit/installer/test_readme_matches_layout.py
  • The smoke check accepts a real npm run build index.html and rejects the server's placeholder page
  • build_core.yml dispatched on this branch (run): freeze and smoke pass on win32-x64, darwin-arm64 and linux-x64, including "serves the Agent UI at /"
  • Next RC: the desktop journey rows pass the setup phase

The frozen gaia shipped since v0.26.0-rc6 carried no web UI build, so
`gaia chat --ui` served only its "backend API" placeholder page. Browser
and phone (tunnel) users got no app, and every installer journey's setup
phase timed out waiting for the setup screen.

The core build now builds the UI before freezing, freeze.py bundles it
where the server looks and refuses to build without it, and the smoke
test checks that / serves the app. The journey rows also upload their
Playwright screenshots, traces and report when setup fails.
@github-actions github-actions Bot added installer Installer changes devops DevOps/infrastructure changes tests Test changes labels Nov 7, 2026
@kovtcharov-amd kovtcharov-amd self-assigned this Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This fixes a real release blocker: since rc6 the frozen gaia shipped without the web UI build, so gaia chat --ui served only the "backend API" placeholder page and every desktop journey timed out at setup. The core build now builds the UI before freezing, the freeze refuses to run without it, and the smoke test fails if / isn't the real app. Those are the right three layers. Nothing blocks the merge. One new test passes only when the full UI dependency set is installed, so it fails confusingly on a lighter dev environment.

The open test-plan item matters most: dispatch build_core.yml on this branch before merging. The fix lives in CI steps that no unit test runs, and that includes npm ci inside the Rocky Linux 9 container on the linux-x64 row.

Real-world evidence

N/A: no evidence bundle was produced for this PR. The change is to CI and installer build tooling, so there is no CLI, API or UI surface the evidence lane could run here. The verdict rests on reading the code and on the new unit tests. Two things still need proof: the frozen build serving the app on all three platforms, which the author's unchecked build_core.yml dispatch would show, and the desktop journey rows, which wait for the next RC.

🔍 Technical details

Issues

🟢 The refusal test depends on the full UI stack being installed (tests/unit/installer/test_core_freeze_webui.py:55)
_verify_freeze_env() checks the installed modules (uvicorn, keyring, pydantic, faiss, fastapi, pypdf, pypdfium2) before it checks for the UI build. test_freeze_accepts_a_webui_build stubs those lists out, but test_freeze_refuses_without_a_webui_build doesn't. In an environment without faiss or fastapi, the test gets the "modules not installed" error instead and fails its "no Agent UI build" assertion. The test_unit.yml lane installs all of them, so CI is green either way. Stub them the same way in both tests:

def test_freeze_refuses_without_a_webui_build(tmp_path, monkeypatch):
    monkeypatch.setattr(freeze, "WEBUI_DIST", tmp_path / "dist")
    monkeypatch.setattr(freeze, "COLLECT_SUBMODULES", [])
    monkeypatch.setattr(freeze, "COLLECT_ALL", [])
    monkeypatch.setattr(
        importlib.util,
        "find_spec",
        lambda name, _real=importlib.util.find_spec: (
            _real(name) if name == "gaia" else object()
        ),
    )

What I checked

  • Bundle path: the bundle destination gaia/apps/webui/dist matches what server.py:1012 resolves from gaia/ui/server.py (parent.parent / "apps" / "webui" / "dist"). A test pins both sides.
  • Linux container: the linux-x64 and linux-arm64 rows build in rockylinux:9 (glibc 2.34). Node 22's prebuilt binaries need glibc 2.28 or newer, so setup-node should work there. That is still unproven until the dispatch runs.
  • Step order: the UI build runs after the RC version stamp, and vite.config reads its version from version.py, so the bundled UI reports the stamped version. A test pins the order.
  • Smoke check: serves_app() requires both <div id="root"> and a type="module" script. That rejects the server's _FALLBACK_HTML (a test reads it from server.py) and a bare root div.
  • Playwright upload: the new upload path e2e/test-results/ covers both outputDir (test-results/output) and the HTML report (test-results/report). It is gated on failure() && SETUP_PHASE, the same as the screenshot upload above it.
  • Other freezes: the flagship and email freezes don't serve the UI, so they don't need this change.
  • Documentation drift: installer/README.md is the only doc that gives the freeze command, and it gains the build step.

Strengths

  • The fix fails loudly at three layers: the freeze refuses to build, the smoke test checks /, and the tests pin the workflow step order. A missing UI can no longer pass as a green build that serves a placeholder.
  • The smoke check is tested against the server's real fallback page rather than a hand-written copy, so it can't drift from it.
  • Uploading the Playwright trace on setup failure will make the next journey failure readable without a rerun.

build_core.yml now builds src/gaia/apps/webui, so a web-UI-only change
must still run the lanes that freeze the core. The two allowlist entries
that excused package.json and package-lock.json are no longer needed.

The smoke test also loads the page's entry script, so a bundle whose
assets are missing fails, and the Node setup caches npm.
@github-actions github-actions Bot added the tui Go terminal UI (gaia-tui) label Nov 7, 2026
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 9d4bf65 Nov 7, 2026
103 of 114 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/frozen-core-webui branch November 7, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes installer Installer changes tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant