Skip to content

fix(cli): gaia chat runs the flagship GaiaAgent - #4520

Merged
kovtcharov-amd merged 6 commits into
amd:mainfrom
kovtcharov:kalin/chat-runs-flagship
Oct 4, 2026
Merged

kovtcharov-amd merged 6 commits into
amd:mainfrom
kovtcharov:kalin/chat-runs-flagship

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

gaia chat, one-shot and interactive, and gaia --cli were still running the retired ChatAgent, so the command line gave a different agent from the one users get in the TUI and Agent UI: a different prompt, tools, skills and memory behaviour. Both now run the flagship GaiaAgent with the same flags, which also makes gaia chat -q "…" the one-shot, claude -p style way to query the flagship.

Test plan

  • pytest tests/unit -k "cli and (chat or memory_drain or launch)": 44 passed; a new test asserts the interactive path builds GaiaAgent
  • gaia chat --model fireworks.deepseek-v4p1-flash -q "What is 17 times 23? Answer with just the number." answers 391, and the log shows the flagship's skill and tool loaders
  • gaia chat interactive: a follow-up that depends on the previous turn is answered in context

gaia chat (one-shot -q and interactive) and gaia --cli still built the
retired ChatAgent profile, so the command-line agent answered with a
different prompt, tool surface and skills than the TUI and Agent UI. Both
paths now build GaiaAgent from GaiaAgentConfig, which takes the same
options, so every chat flag keeps working.
@github-actions github-actions Bot added documentation Documentation changes cli CLI changes tests Test changes labels Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

Pointing gaia chat and gaia --cli at the flagship is the right call: the command line now gets the same agent as the TUI and Agent UI. The swap itself is clean, since GaiaAgentConfig extends the chat config and accepts every flag the CLI passes. The blocker is install state. gaia chat now needs the flagship's Python package importable inside the gaia process, but gaia init installs the flagship as a native binary and never installs that package.

  • Users who follow gaia init's instructions can end up with a broken gaia chat. After a default gaia init plus the chat package that init's completion message asks for, gaia chat used to work. Now it fails with "The GAIA agent is not installed". Init still prints gaia chat as ready, and its fix-up hint still names only the chat package, which is no longer enough. Update init's readiness check and hint to look for the flagship package. Better still, have gaia chat fall back to the hub-installed flagship. Then test from a clean gaia init rather than a dev checkout where every hub package is already editable-installed.

Real-world evidence

N/A: no evidence bundle was produced for this run. The PR description says a one-shot gaia chat -q answered correctly but doesn't paste the output, and the interactive follow-up test is still unchecked. The verdict rests on static review. The blocker above only shows up from a fresh gaia init state, which a dev machine with editable installs won't hit.

🔍 Technical details

🔴 gaia chat now requires a gaia_agent import that gaia init doesn't provide (src/gaia/cli.py:581, src/gaia/cli.py:954)

  • INIT_PROFILES["gaia"] (src/gaia/installer/init_command.py:~80) installs the flagship from the Hub, and the adjacent comment says it "publishes it as a native binary (gaia-agent), not a wheel". _is_hub_agent_available (init_command.py:1679) confirms this: a binary install shows up only as a sentinel under ~/.gaia/agents, with no importable gaia_agent module. AgentRegistry's sys.path priming (src/gaia/agents/registry.py:~695) adds only ARTIFACT_KIND_WHEEL installs.
  • _chat_agent_available() (init_command.py:1705) and _print_completion (init_command.py:1839) still gate every gaia chat next step on gaia_agent_chat alone, and the remedy line runs source_install_command('gaia-agent-chat'). After this PR both are wrong: init reports gaia chat as ready when it will raise, and its hint doesn't fix the problem. The comments on PROFILE_REQUIRED_AGENTS (init_command.py:62-67) and the gaia profile (init_command.py:84-86) are now stale too.
  • Suggested fix: add "gaia" to the agents gaia chat needs (PROFILE_REQUIRED_AGENTS), have _chat_agent_available check find_spec("gaia_agent"), and update the completion hint to source_install_command('gaia-agent-gaia'). Add a unit test that stubs find_spec("gaia_agent") → None with the chat wheel present and asserts init does not advertise gaia chat as ready.

🟡 One-shot path has no test for the new agent class (tests/unit/test_cli_memory_drain_on_exit.py)

The new test covers only _launch_interactive_cli. The gaia chat -q branch of async_main, which the PR description calls the headline use case, has no assertion that it builds GaiaAgent instead of ChatAgent. The same stubs can be reused: call async_main("chat", query="hi") and assert GaiaAgent is constructed and process_query is called.

🟢 Stale comment (src/gaia/cli.py:~714)

The session-creation comment still says _ensure_tool_loader_reset is "a ChatAgent method" and that the drift is with "gaia-agent-chat". That's still technically true through inheritance, but the drift that matters now is between core and the flagship wheel as well. It's a one-word wording fix and doesn't block.

Strengths

  • Nothing is lost in the swap: GaiaAgentConfig only changes defaults on ChatAgentConfig, so every CLI flag keeps working.
  • Updating the fixture to stub both gaia_agent and gaia_agent_chat keeps the memory-drain tests meaningful. The new assertion pins the agent class so a silent revert would fail CI.
  • The docs change in cli.mdx ships in the same PR as the behaviour change.

kovtcharov and others added 5 commits October 1, 2026 22:53
`gaia chat` now runs the flagship, so the chat wheel alone no longer makes it
work. `gaia init` still reported `gaia chat` ready with only that wheel and its
hint named only the chat package; it now checks for both wheels and names the
missing ones in install order. The flagship's hub binary does not count, since
nothing can import it.

Tests that stubbed only the chat wheel now stub the flagship too, a one-shot
`gaia chat -q` test pins the agent class, and the clean-install journey test
installs a flagship fixture wheel and no longer lets the checkout's real hub
agents shadow its fixtures through PYTHONPATH.
…lback

Both gaia chat entry points guarded the session bootstrap with hasattr and,
when the method was missing, built the session by hand and swallowed tool
loader errors at debug level. The flagship wheel hard-depends on the chat
wheel, so the method always exists; call it directly. A missing flagship wheel
already fails with the install command, and a test now pins that it exits 1
and never runs the base ChatAgent instead.
…w calls

Two stand-in agents (the one-shot output test and the hub-wheel journey
fixture) lacked _ensure_tool_loader_reset and had relied on the removed
version-drift branch. They now implement it as the real agent does.
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Oct 4, 2026
…md#4612)

A failed `gaia chat --query` exited 0 and printed a stray `1` on stdout,
so `gaia chat -q "..." && next-step` ran next-step after the agent
failed. `gaia stats` hid every backend error (for example, an
unreachable Lemonade) behind "No stats available". Now a failed query
exits 1 (130 on Ctrl+C) with nothing extra on stdout. A stats error
prints its cause and exits 1. "No stats yet" is a normal empty state
that exits 0.

This touches only the chat block's two `except` handlers, so it merges
cleanly in either order with amd#4520.

## Test plan
- [x] `pytest tests/unit/cli/test_cli_exit_codes.py`: 8 tests run the
real `gaia.cli.main` entry point. 6 fail on `main` and pass on this
branch.
- [x] `pytest tests/unit/cli tests/unit/test_cli*.py` with `GAIA_HOME`
and `GAIA_DAEMON_HOME` pointed at fresh temp dirs: 702 passed. The 4
`test_gaia_binary_on_path` cases pass once the venv's `bin` is on
`PATH`.
- [x] black, isort, and pylint pass on `cli.py` (both `--enable=E,W0201`
and the repo `.pylintrc` set).
- [ ] Manual: with Lemonade stopped, run `gaia stats; echo $?`. It
should print the connection error and `1`.

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 4, 2026
Merged via the queue into amd:main with commit 1769af2 Oct 4, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/chat-runs-flagship branch October 4, 2026 19:48
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 4, 2026
…4675)

Main's unit test lanes are red:
`test_chat_query_success_exits_zero_without_printing_status` fails on
Linux, macOS and Windows. amd#4520 made `gaia chat` call
`agent._ensure_tool_loader_reset()` directly (no fallback), and amd#4612
added this test with a stub agent that lacks the method. Each passed on
its own; main broke when both landed. The stub now has the method, as
the other chat-path stubs already do.

## Test plan
- [x] `pytest tests/unit/cli/test_cli_exit_codes.py` passes
- [ ] `Unit Tests` green on main after merge

Co-authored-by: Kalin Ovtcharov <[email protected]>
aksh8b pushed a commit to aksh8b/gaia that referenced this pull request Oct 5, 2026
`gaia init` printed "failed models may be corrupted, here's how to
delete them" and then exited 0 with the completion banner, so scripted
installs and CI counted a setup whose model can't answer as done. Now a
model that fails its inference test ends init with exit 1 and an error
naming the model, under the same fix steps. Two softer cases stay
non-fatal, because setup still works, but are no longer quiet: a model
whose context size Lemonade doesn't report gets a warning with the fix,
and a failed Windows Installer process check is announced (msiexec still
fails loudly with 1618 on a real conflict).

Overlap: amd#4617 and amd#4520 also edit `init_command.py`, but in different
hunks. This branch merges cleanly with both, so merge order doesn't
matter.

## Test plan
- [x] `pytest
tests/unit/installer/test_init_verify_fails_on_bad_models.py`: init
exits 1 with the fix steps on a failed model and exits 0 when all pass;
the unverified-ctx warning and log entry; the announced msiexec-check
failure. 4 of the 5 tests fail on `main`.
- [x] `pytest tests/unit/test_init_command.py tests/unit/installer
tests/unit/chat/ui tests/unit/test_context_size_resolution.py` (1459
passed), run with fresh `GAIA_HOME` / `GAIA_DAEMON_HOME`
- [ ] On a machine with a deliberately truncated model file, `gaia init
--profile <p> --yes` exits non-zero and prints the delete/re-download
steps

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 6, 2026
5 of 10 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 6, 2026
# GAIA v0.25.0 Release Notes

## Breaking Changes

- **`gaia chat` runs the flagship GAIA agent**, the same agent as the
TUI and Agent UI, instead of the retired ChatAgent. `gaia chat -q "…"`
queries it once. (PR [amd#4520](amd#4520))
- **`gaia talk` transcribes and speaks through Lemonade** — it uses
Lemonade's Whisper and `kokoro-v1`, and stops with the reason if
Lemonade is down. The `[audio]` extra is gone; `pip install
amd-gaia[audio]` only warns. (PR
[amd#4665](amd#4665))
- **The Agent UI runs only the GAIA agent** — the Agent Hub home, agent
picker, and custom-agent export/import are removed from the UI. The CLI
and eval harness can still run other agents. (PR
[amd#4509](amd#4509))
- **The retired nomic embedder is removed** — memory saved with it is
re-embedded on first start. (PR
[amd#4489](amd#4489))
- **Indexed documents are re-indexed once** — the document cache is now
keyed on chunking settings, so the first query after upgrading rebuilds
it. (PR [amd#4624](amd#4624))
- **A skill that asks for more than its tier allows no longer loads** —
the permission ceiling is checked at every load, so a skill already on
disk that exceeds it is refused with the reason. (PR
[amd#4849](amd#4849))

## What's New

- **A larger local model where the GPU holds it** — `gaia init` picks
Qwen3.6-35B-A3B on a 64 GB+ Strix Halo or a 32 GB GPU and keeps
Gemma-4-E4B elsewhere, with each context window sized to available
memory. Qwen3.8 Flash Next is opt-in on 128 GB Strix Halo. (PRs
[amd#4479](amd#4479),
[amd#4670](amd#4670),
[amd#4671](amd#4671),
[amd#4658](amd#4658),
[amd#4655](amd#4655))
- **The Agent UI opens straight to a chat and sets itself up** — a fresh
install runs the same setup steps as the TUI in the window, with
provider, key and model settings, permission modes, and revocable
"always allow" grants. (PR
[amd#4509](amd#4509))
- **A much smaller install** — PyTorch, transformers and accelerate are
gone from the core, `[ui]` and `[talk]` installs; the desktop app's
Python environment drops from ~0.9 GB to ~0.1 GB on Windows. (PRs
[amd#4666](amd#4666),
[amd#4621](amd#4621),
[amd#4665](amd#4665))
- **One Windows installer for the desktop app and the terminal**, with a
GAIA Windows Terminal profile. (PRs
[amd#4720](amd#4720),
[amd#4707](amd#4707))
- **A "no" holds** — a declined action isn't retried through another
tool; the agent asks again with the exact command. The TUI gains
Shift+Tab permission modes. (PRs
[amd#4460](amd#4460),
[amd#4461](amd#4461))
- **Answers are checked against what the tools actually did** — the
agent looks at files you name before answering about them, and a short
plain-English note appears only when work isn't confirmed. (PRs
[amd#4532](amd#4532),
[amd#4501](amd#4501),
[amd#4508](amd#4508))
- **One shell session** — commands share a persistent shell, risky ones
ask instead of being refused, and "full access" is one setting
everywhere. (PR [amd#4408](amd#4408))
- **Memory surfaces what's relevant to each request, with its age**,
keeps what fixed a failure as a lesson for that workspace, and extracts
after the answer instead of before it. (PRs
[amd#4061](amd#4061),
[amd#4066](amd#4066),
[amd#4406](amd#4406))
- **`gaia.log` stays bounded** — it rotates at 10 MB with three backups
(`GAIA_LOG_MAX_MB`, `GAIA_LOG_BACKUPS`). (PRs
[amd#4668](amd#4668),
[amd#4760](amd#4760))
- **Child processes get a trimmed environment** — shell, MCP and skill
children no longer inherit GAIA's internal credentials; `GAIA_NO_DOTENV`
skips loading `.env`. (PRs
[amd#4635](amd#4635),
[amd#4659](amd#4659))
- **Every file tool checks the allowed-folders rule**, and paths inside
an inline shell script are checked one by one. (PRs
[amd#4656](amd#4656),
[amd#4758](amd#4758))

## Bug Fixes

A selection of the user-visible fixes; the full list is in the changelog
below.

- **Local Qwen models no longer loop on repeated tool calls** — they run
with their model card's sampling instead of near-greedy settings. (PR
[amd#4655](amd#4655))
- **Qwen3.6 runs on a Strix Halo with an older AMD driver** — it used to
crash on its first token, so `gaia init` failed; GAIA now turns off the
Vulkan path that crashes on those drivers only, and newer drivers keep
the faster path. (PR [amd#4674](amd#4674))
- **A long PDF no longer hangs or times out while indexing** — big
documents index in the background, and PDFs that only carry
owner-password restrictions now index. (PRs
[amd#4754](amd#4754),
[amd#4679](amd#4679),
[amd#4734](amd#4734))
- **Document answers cite the right document and page**, and every chunk
is embedded whole instead of its first 1,200 characters. (PRs
[amd#4688](amd#4688),
[amd#4723](amd#4723))
- **`gaia init` fails when model verification fails**, shows downloads
live, and no longer hangs while Lemonade hashes a large model. (PRs
[amd#4620](amd#4620),
[amd#4564](amd#4564),
[amd#4673](amd#4673))
- **`gaia init` adds a profile's extras without reinstalling GAIA**,
which failed on Windows while `gaia.exe` was running. (PR
[amd#4672](amd#4672))
- **Every SDK and CLI entry point starts GAIA's own Lemonade**, and
every call goes to the resolved URL with its API key. (PRs
[amd#4657](amd#4657),
[amd#4627](amd#4627))
- **Local chat stays cached across turns** — the system prompt is fixed
and side requests no longer evict the conversation. (PRs
[amd#4698](amd#4698),
[amd#4543](amd#4543))
- **A cloud model selection never preloads a local model**, and cloud
models no longer get llama.cpp-only fields. (PRs
[amd#4757](amd#4757),
[amd#4709](amd#4709))
- **The Agent UI stops claiming "100% local" while chat goes to a cloud
model**, and the chat header names the session's real model. (PRs
[amd#4711](amd#4711),
[amd#4550](amd#4550))
- **Enter can't approve a permission prompt**, and prompts wait 10
minutes before timing out. (PRs
[amd#4700](amd#4700),
[amd#4699](amd#4699))
- **Stopping a run keeps the turn and its steps visible.** (PR
[amd#4743](amd#4743))
- **A file edit keeps the file's line endings** — a one-line edit on
Windows used to rewrite every line ending, so a small change showed up
as the whole file changed. (PR
[amd#4864](amd#4864))
- **A broken agent install is reported as broken, not as missing** — the
error names both package versions and the real import error, and
suggests a reinstall that works. (PR
[amd#4588](amd#4588))
- **A meeting or document summary is never cut off mid-sentence** — a
thinking model used to spend the summary's output budget reasoning, so a
long meeting lost its second half. (PR
[amd#4827](amd#4827))
- **"What can you do?" gets an answer** instead of an attempt to
generate an image of the question. (PR
[amd#4809](amd#4809))
- **Writes and approved edits can't reach credential folders**
(`~/.ssh`, `~/.aws`, `~/.kube` and others), and shell option values and
script arguments get the same path check as plain paths. (PRs
[amd#4848](amd#4848),
[amd#4847](amd#4847))
- **`gaia connectors connect google --grant-agent installed:gaia`
works** — it used to fail with no sign-in link for the shipped agent; it
now asks for read-only Gmail and grants exactly that. (PR
[amd#4859](amd#4859))
- **A "no" to creating a folder also covers writing into it** — GAIA no
longer asks again to create the same folder a different way. (PR
[amd#4857](amd#4857))
- **`gaia skill import` runs the same checks as a hub install** — https
only, the audit, the permission ceiling, and an explicit opt-in for
skills that ship code. (PR
[amd#4849](amd#4849))
- **Memory off and private chats apply to scheduled and background runs
too.** (PRs [amd#4842](amd#4842),
[amd#4821](amd#4821))
- **Memory stops false apologies and reusing deleted values**, saves
"remember this" requests, and skips loading the embedder when memory is
off. (PRs [amd#4708](amd#4708),
[amd#4756](amd#4756))
- **A reply cut off by the token limit is continued** instead of ending
mid-sentence, and a tool call cut off at the output cap is retried
shorter. (PRs [amd#4054](amd#4054),
[amd#4556](amd#4556))
- **The TUI remembers the chosen model** across restarts and
agent-process restarts. (PRs
[amd#4497](amd#4497),
[amd#4710](amd#4710))
- **`gaia uninstall --purge` removes installer binaries, PATH edits and
daemon state.** (PR [amd#4413](amd#4413))

## Contributors

Thanks to the community members who contributed to this release:

- [@itomek](https://github.com/itomek) — the flagship's browser and tool
picker, one shell session, memory extraction off the answer path, stale
tool-result eviction, the TUI's sourced Fireworks rankings, and
`--purge` cleanup (PRs [amd#4407](amd#4407),
[amd#4408](amd#4408),
[amd#4406](amd#4406),
[amd#4465](amd#4465),
[amd#4414](amd#4414),
[amd#4413](amd#4413))
- [@mikemikimike](https://github.com/mikemikimike) — chained shell
command timeouts, bundled skills in frozen builds, and sidecar cleanup
reporting (PRs [amd#4463](amd#4463),
[amd#4467](amd#4467),
[amd#4419](amd#4419))
- [@Hashim1999164](https://github.com/Hashim1999164) — honoring
`GAIA_HOME` for cache, chat and index paths (PR
[amd#4381](amd#4381))
- [@krtadev](https://github.com/krtadev) — `~` expansion in file and
document tool paths (PR [amd#4576](amd#4576))
- [@aksh8b](https://github.com/aksh8b) — telling a broken agent install
apart from a missing one, with a reinstall hint that works (PR
[amd#4588](amd#4588))
- [@Dev-next-gen](https://github.com/Dev-next-gen) — numeric prerelease
ordering in the hub (PR [amd#4517](amd#4517))
- [@vianmangal](https://github.com/vianmangal) — recording denied tool
calls as unsuccessful in memory (PR
[amd#4412](amd#4412))
- [@GaetanVDB07](https://github.com/GaetanVDB07) — links to upstream
credential setup guides for connectors (PR
[amd#4669](amd#4669))
- [@rradjabi](https://github.com/rradjabi) — moving self-hosted CI jobs
to the xsj-dispatch runner pool (PR
[amd#4534](amd#4534))




## Also in this PR

- **Hub floors raised to core 0.25.0** — the chat agent imports the
allowed-folders check that only 0.25.0 ships (amd#4656), so
`gaia-agent-chat` goes to 0.2.0 with `amd-gaia>=0.25.0`, and the
flagship requires `amd-gaia>=0.25.0` and `gaia-agent-chat>=0.2.0`.
- **Two follow-ups held back until that floor could rise** —
`~/.gaia/logs/gaia-agent.log` now rotates like `gaia.log` (amd#4668), and
the chat agent's Python runners and Windows notification start their
children without GAIA's internal credentials (amd#4659).

The full changelog (300 commits) is in `docs/releases/v0.25.0.mdx`.

## Test plan

- [x] `util/validate_release_notes.py docs/releases/v0.25.0.mdx --tag
v0.25.0` passes; narrative is 590 words (cap 600)
- [x] `util/check_component_core_api.py --release-version 0.25.0` passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
hub/agents/chat/python/tests/test_chat_dependency_floor.py
hub/agents/chat/python/tests/test_dependency_floor.py
hub/agents/gaia/python/tests/test_gen_binaries_lock.py` (72 passed)
- [x] `pytest hub/agents/gaia/python/tests/test_stdio.py` (91 passed,
incl. the new rotation test); `pytest
tests/unit/test_execute_python_file_cwd.py
tests/unit/test_run_python_tool.py` (42 passed)
- [ ] `mintlify validate` (docs CI job) — timed out locally, relying on
CI
- [x] Full flagship eval on main 9ce6598
(https://github.com/amd/gaia/actions/runs/37436249503): 181/308
scenarios pass vs 100/183 for the same categories in the baseline, 39
FAIL→PASS, 13 PASS→FAIL (two fixed in amd#4878, held until after rc1);
retrieval lane still finishing at merge time
- [ ] CI green

## Release checklist

- [ ] Publish `gaia-agent-chat` 0.2.0 only after core 0.25.0 is on PyPI
— it fails at import on an older core
- [ ] Build Installers on the merged SHA (pre-tag verification) before
pushing `v0.25.0`
- [ ] terminal-hub 0.25.0 published before the flagship npm release
consumes `binaries.lock.json`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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

cli CLI changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants