Skip to content

docs(plans): audit and plan for binaries-only Agent UI and TUI - #6495

Closed
kovtcharov wants to merge 5 commits into
amd:mainfrom
kovtcharov:docs/binaries-only-plan
Closed

kovtcharov wants to merge 5 commits into
amd:mainfrom
kovtcharov:docs/binaries-only-plan

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Every desktop install still downloads Python and amd-gaia[ui] from PyPI on first run and on every update. Several features also still try to import the GAIA agent's Python package, which a packaged install never has. As a result, gaia -p, background goals and skill preferences fail on users' PCs, and some errors tell users to pip install from git. This plan inventories every one of these with its location and orders the fix into reviewable PRs. The end state is a frozen gaia core shipped inside the Agent UI and TUI installers, with the agent always running as the hub binary. PyPI stays for third-party developers only.

The goal is speed, so the plan also sets the baseline every conversion PR reports against. The clean-runner half is committed: raw phase times for v0.25.4-rc3 from 7 installer-journey runs. On those runners, the Windows desktop setup takes 124 s from install to a serving backend. The hardware half (gaia init steps, backend and agent cold start, first-chat latency) is marked not yet measured until it runs on a clean AMD PC.

No runtime changes: docs, the CI baseline data, and util/measure_app_speed.py (with unit tests), the script that takes the hardware half.

Test plan

  • python util/check_doc_links.py --internal-only: 1006 links, 0 broken
  • docs/docs.json and the baseline JSON parse; the page is listed under Plans › Infrastructure
  • python installer/headless/propose_thresholds.py --runs 7 --release v0.25.4-rc3 reproduces the committed medians
  • Reviewer: spot-check that the file:line references in §1–§3 point at the code they describe

Every desktop install still builds ~/.gaia/venv from PyPI, and gaia -p,
background goals and skill preferences still look for the agent's Python
package, which a packaged install never has. This audits each PyPI
install, in-process agent path, pip-remedy string and interpreter
assumption in both apps, and orders the fix into reviewable PRs ending in
a frozen gaia core shipped inside the installers.
@github-actions github-actions Bot added the documentation Documentation changes label Nov 3, 2026
The point of going binaries-only is speed, so every conversion PR needs a
before/after against numbers taken first. This commits the clean-runner
half (raw phase times for v0.25.4-rc3 from 7 installer-journey runs),
defines the six metrics and how each is measured, marks the hardware
metrics as not yet measured, and states that PyPI is only for third-party
developers building on GAIA.
@github-actions github-actions Bot added the installer Installer changes label Nov 3, 2026
…file

The binaries-only work is judged on speed, and the hardware half of its
baseline (backend install per stage, gaia init per step and model,
backend and agent cold start, first-chat latency) can't come from CI
runners. This script measures it on a real PC from a throwaway profile
with empty uv, Python, Hugging Face and Lemonade state, using the
release's own backend installer. It refuses to run while anything else
is loading a model, testing or eating CPU, and keeps the profile path
short enough that Windows' path limit can't fail the backend.
@github-actions github-actions Bot added the tests Test changes label Nov 3, 2026
rezamuliawijaya pushed a commit to rezamuliawijaya/gaia that referenced this pull request Nov 7, 2026
GAIA no longer installs Python or a PyPI package on a user's PC. The
desktop app built `~/.gaia/venv` from PyPI on first launch. The terminal
UI's installers shipped no `gaia`, so setup and the daemon failed until
the user also ran the one-line installer, which built the same venv. Now
one frozen `gaia`, built from the same commit, ships everywhere: inside
the desktop app, beside `gaia-tui` in every terminal installer, and as a
checksummed release file that `install.sh`/`install.ps1` download. On a
clean profile on a Strix Halo PC, with no Python or uv on PATH, the
desktop app's backend was healthy 6 s after launch, compared with a 44 s
install plus 76 s to healthy on a CI runner before. This covers steps
1–10 of the binaries-only plan (amd#6495). Step 1 (no pip extras) holds for
both apps: the frozen build skips pip extras, and both apps pass
`--skip-pip-extras`. `pip install amd-gaia` users still get them.

- **Desktop app.** The app runs `<resources>/core/gaia`. If that file is
missing, it says to reinstall rather than fall back to PyPI. An AppImage
runs a copy under `~/.gaia/core`, because its mount goes away while the
daemon keeps running. The bundled uv is gone.
- **Terminal installers.** The `.pkg`, `.deb`/`.rpm` and the Windows
setup's terminal component carry the core and put `gaia` on PATH. The
terminal UI runs the `gaia` beside itself before any other.
- **One-line installers.** They download `gaia-core-<platform>.tar.gz`,
check it against `gaia-core-SHA256SUMS.txt`, and use it to read the
agent manifest, so they need no Python at all. `publish.yml` attaches
the core to every release, and the release check refuses one without it.
- **Updates and removal.** The daemon is stopped before an update or
uninstall replaces its files. The NSIS installers, the `.deb`/`.rpm`
pre-remove hooks and the desktop app's update quit (the only hook macOS
has) all do this. The frozen app also replaces a daemon still running an
older release's venv. After an app update, the agent is refreshed once.
- **The agent runs as its own binary everywhere.** Where it isn't
importable, `gaia -p`, `gaia chat`, background goals (amd#5840) and
skill-preference saves now run it through the daemon, as Agent UI chat
does. Before, they failed or returned 503. A failed model call is a
failed run (exit 1), and the apps' hints no longer tell users to
pip-install.
- **Frozen-build guards.** `gaia init` skips pip extras, a wheel-type
hub agent is refused before download, and GAIA's own `-m`/`-c`
relaunches run through `gaia.frozen`.

Still source-only: `gaia eval agent`, which runs the flagship
in-process. The npm `gaia-ui` package and running the app from source
still use a venv, as developer routes.

Closes amd#5840.

## Test plan
- [x] `installer/core/smoke_test.py` passes on win32-x64, darwin-arm64,
darwin-x64 and linux-x64 (Rocky 9) in CI, and on a local Windows build.
It checks: `--version`; bundled modules import; `gaia_agent`, torch and
PyInstaller are absent; the `-m`/`-c` relaunches; running as `gaia-mcp`;
`gaia init --check --json`; daemon start, status and stop; `gaia chat
--ui` answering `/api/health`.
- [x] Packaged Windows app launched from an empty profile with a minimal
PATH: healthy in 5.7–6.1 s, no `~/.gaia/venv`, and the setup screen
shows "All 5 checks passed". Through the frozen core, `gaia init
--agent-only` installed the flagship in 13 s and its sidecar started.
- [x] Terminal `.deb` and `.rpm` built with the real Linux core in a
container: both install, run `gaia --version` and remove cleanly (Debian
bookworm, Fedora).
- [x] Frozen `gaia -p` and `gaia chat` in a throwaway home: the daemon
started the agent binary and relayed the turn. With the model server
unreachable, both reported the agent's error and exited 1.
- [x] `pytest`: installer, hub, daemon, relay, agent-loop, skills,
release-asset and frozen-relaunch suites (Windows), plus the POSIX-shell
installer tests in a Linux container. Electron Jest suite passes; Go
`gaiainit` tests pass.
- [x] CI: desktop AppImage/DMG structural smokes and the AppImage distro
matrix reach the bundled core.
- [x] CI: terminal package smokes on macOS and Linux, and the Windows
setup smoke.
- [ ] On the next RC: headless installer journeys show desktop
install-to-healthy below the venv-build numbers in
`installer/install_time_thresholds.json`, and `install.sh`/`install.ps1`
pinned to that RC install with no Python on the PC.
- [x] First local-model chat through the CI-built frozen Windows `gaia`,
from an empty home with no Python or uv on PATH: `gaia init
--agent-only` installed the flagship in 8.6 s, and `gaia -p --model
Qwen3.5-4B-GGUF` answered and exited 0.
- [ ] Clean-PC timing with a fresh model download (§5.3 baseline). Not
run here: the PC's GPU was in use by other work.

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
@kovtcharov
kovtcharov marked this pull request as ready for review November 12, 2026 06:11
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

The plan and the committed CI baseline read well and are scoped as docs and data. The later commit also adds a script that times setup and first chat on real hardware, plus its unit tests. One of those tests will fail on the Linux and macOS unit lanes. Make that check work on every platform and this can merge.

  • A new unit test only passes on Windows. It expects the throwaway profile's PATH to be joined with ;, but Linux and macOS join it with :. Both of those lanes run all of tests/unit/, so main would go red. Build the expected value with the platform's separator. The fix is one line.
  • Smaller notes: the PR description still says "docs and data only," and the plan's "Not measured yet" section still describes the timing script as future work, though this PR ships it. Separately, the script's gaia init step has no time limit.

Real-world evidence

N/A: the change is docs, data and a Windows-only measurement script, and no evidence bundle was produced. This verdict rests on static review. I also ran the failing PATH assertion by hand on Linux, and it fails as described: the result is C:\Windows\System32:C:\node, where the test expects ;. pytest isn't installed on this runner, so the rest of the new tests were not run. The PR's CI unit lanes have not run yet.

🔍 Technical details

🟡 test_clean_env_hides_this_pcs_installs fails on Linux and macOS (tests/unit/test_measure_app_speed.py:53)

clean_env joins path_dirs with os.pathsep (util/measure_app_speed.py:127), which is : on POSIX. The assertion hard-codes ;. test_unit.yml runs pytest tests/unit/ on ubuntu-latest (line 354) and macos-latest (line 669), and the file needs nothing from Windows to import (psutil is a core dependency), so it gets collected and fails. Reproduced by importing the module and calling clean_env on Linux: the result is 'C:\\Windows\\System32:C:\\node'. Add import os at the top of the test, then:

    assert env["PATH"] == os.pathsep.join([r"C:\Windows\System32", r"C:\node"])

🟢 Doc and description drift

  • docs/plans/binaries-only.mdx §5.3 (M3–M6 row) and the step-0 row of the PR table still say the script still has to be written. Point them at util/measure_app_speed.py and its usage line.
  • The PR body says "Docs and data only, no runtime changes," but commit 47962cf adds util/measure_app_speed.py and a test. Mention them so reviewers know there is code to read.

🟢 gaia init has no time limit (util/measure_app_speed.py:469-492)
Run.gaia_init reads the Popen stdout until EOF and then calls proc.wait() with no timeout. Every other step has a timeout: 3600 s for the install and 600 s for the backend and agent. If gaia init hangs, for example on a stalled model pull, the run hangs too and never reaches the except that kills the profile's processes. A wall-clock check inside the read loop, or a watchdog thread, would follow the same pattern as the other steps.

Strengths

  • The script's parsing and process-detection logic is separate from the code that drives the machine, and it is unit-tested (stage splitting, step and model timing, SSE parsing, the busy-process filter, the RC tag-to-version mapping).
  • The script fails with a clear error instead of degrading: a busy PC, a long work path, a missing tool, or an install that never finished each raises a MeasureError that says what to do.
  • The committed baseline records its source runs and the command that reproduces it, so it can be re-derived rather than trusted.

…a init

Two of the script's unit tests failed on the Linux and macOS lanes: the
clean-profile PATH test hard-coded the Windows separator, and the busy
check read Windows paths with the host's path rules, so it missed a
`gaia.exe eval` there. The busy check now always reads Windows paths.

A hung `gaia init` (a stalled model pull) hung the whole run, so it now
stops after two hours along with any children holding its output, and says
so. The remaining subprocess calls get a timeout, and the plan names the
script where it still called it future work.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

The review's findings are fixed and the unit tests now pass off Windows, but the audit itself is out of date: at least three of its "fails on users' PCs" rows have been fixed on main since it was written, so it should be re-checked against current main before it's marked ready.

  • Fixed in this push: the two tests that failed on Linux and macOS, a time limit on gaia init (two hours, and it stops the children holding its output too), timeouts on the remaining subprocess calls, and the plan and description now name the measurement script.
  • Still open: re-audit the §1–§3 tables. Rows already fixed on main should move to a "done" note, and the PR order in §6 should drop the steps they covered.
🔍 Technical details
  • B1: print_mode.py now runs gaia -p through the agent binary ("The agent ships as its own binary here, as the apps do").
  • B3: SIDECAR_TICKS_UNSUPPORTED no longer exists in ui/agent_loop.py.
  • B7: routers/skills.py now falls back to _preference_schema_beside_the_agent_binary.
  • Line references across the tables have drifted with these changes (e.g. _agent_unavailable_message is now at _chat_helpers.py:1455, not :1395).
  • The busy-process check now reads paths with PureWindowsPath, so a gaia.exe eval is caught under any host's path rules; tests cover both path styles. kill_tree_after is tested with a grandchild that holds stdout open.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Closing: desktop installs no longer pull Python from PyPI (#6783), so this plan's premise is out of date. Reopen or refresh if the remaining items are still wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes installer Installer changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants