Repository navigation
feat(tui): name the running agent, fix /memory on a hub install, add /agents - #3987
Conversation
…/agents `/memory` printed "This agent does not support /memory." on any machine that followed the documented install path — the installer, then the `gaia init` the installer tells you to run. `gaia init` hub-installs the flagship, which flips it from the subprocess transport to the daemon transport, and the memory dump was only ever reachable over stdio. The palette, /help and the docs all advertised it anyway. The sidecar now serves `GET /v1/gaia/memory` (contract 2.13) and *SSEClient implements MemoryProvider against it, so both install shapes expose the same command set. Capability is negotiated, not assumed. Once both transports implement MemoryProvider a type assertion on the client stops discriminating anything, so the palette and /help gate on a new client.CapabilityReporter tri-state instead: supported / unsupported / not-yet-known. Unknown shows the command — hiding one we have not finished asking about is worse than a refusal that explains itself — and a probe that never heard back stays unknown rather than being cached as "this agent is too old", which would tell the user to reinstall a current agent. The chat also never said which agent was answering. The flagship's display name is literally "GAIA", so both sites that would print it suppressed it as a duplicate of the product word, leaving the header naming the model but not the agent. It now reads `GAIA │ agent gaia v0.2.0 │ <model>`, carrying the stable id because that is what `--agent` takes, and giving way before the model chip on a narrow terminal. And `/agents` lists every installed agent in chat — id, name, version, running state — and switches to one without leaving the TUI. Switching is in place: the client is swapped, the per-agent readiness gate re-runs, and the transcript stays on screen with a divider saying plainly that the new agent cannot see the conversation above it. Backing out of that gate returns to the session you were already in instead of quitting the program. This does not restore the hub browser #3120 deleted: no browsing, no installing, no discovery of what is not installed. `/model` has the same daemon-transport gap as `/memory` and is tracked separately in #3985 — the sidecar has no equivalent of stdio's `run_model_command`, so it is still answered by the LLM on a hub install. Closes #3978 Closes #3979 Closes #3980
Skill audit
✅ All audited skills cleared the tier they claim. Per-finding detail is withheld here on purpose. Read it in the Security > Code scanning tab, or download the |
Approve with suggestionsThis fixes Nothing blocking. One thing worth a second look: the refusal shown when a transport genuinely cannot do Real-world evidenceThe CI evidence harness failed before producing anything — (go1.26.3, Linux; every other package in those trees also passed.) The Python tests could not run here — no The PR description carries on-machine evidence matched to the changed surfaces: the 🔍 Technical detailsIssues found🟢 The unsupported-transport refusal names the wrong transport ( This branch only fires when the client is not a 🟢 The memory route builds its agent on the event loop (
🟢 Ctrl+C closes the agents panel instead of quitting (
🟢 The startup capability probe has no deadline (
🟢
Strengths
|
… a refusal Five points from the PR review, none of which changed behaviour a user relies on: The refusal shown when a session genuinely cannot fetch memory blamed "the daemon transport" — which, after this change, is the transport that serves it. It now names the session's connection rather than pointing the reader at the wrong thing. `GET /v1/gaia/memory` built its throwaway agent inline in the async handler, so registering 70+ tools and loading skills stalled every concurrent run's SSE heartbeat. It moves to a worker thread, like the dump itself already did. The startup capability probe ran on `context.Background()`, and it can spawn a sidecar — a wedged daemon left the goroutine alive for the whole session. It is bounded now; timing out leaves the capability unknown, which shows the command rather than hiding it. Ctrl+C closed the `/agents` panel where every other panel — and the status bar's own "Ctrl+C quit" — means quit, so leaving took two presses. It quits. `switchAgent` appended the divider into the slice `Messages()` hands back, which is the live chat's own; it copies first, so correctness no longer rests on the chat model not being updated while the gate is up.
|
All five suggestions applied in 23aba2c — thanks, they were all correct. The refusal blaming "the daemon transport" was the sharpest catch: that string came verbatim from #3978's acceptance criteria, written when the daemon transport was exactly the one that couldn't serve memory. This PR makes it the one that can, so the text aged out the moment it landed. It now names the session's connection instead. 🔍 The other four
Re-verified after the change: On the evidence stage: noted that the CI harness failed before producing anything. The on-machine evidence in the PR description was gathered by hand against a genuinely hub-installed daemon-transport flagship, not from that lane. |
…amd#3988) `/memory` is currently offered on the `email` agent and then 404s — the exact advertised-then-refused defect amd#3978 removed, reintroduced on a different agent by amd#3987's own fix. This scopes the capability to the agent that actually has the route. Found by an adversarial review pass whose report arrived after amd#3987 merged. ## Why it slipped through The gate asked one question: *is the peer's contract ≥ 2.13?* But every sidecar numbers its own contract independently, so the same number means different things across them — `email` is already at **2.14** for unrelated reasons and has no memory route at all. Verified on a live machine, not just read: ``` $ grep "email sidecar contract" ~/.gaia/host/daemon.log | tail -1 email sidecar contract: apiVersion=2.14 agentVersion=0.6.0 $ grep -c "memory" hub/agents/email/python/gaia_agent_email/server.py # routes 0 ``` So `Supports(CapabilityMemory)` returned `(true, true)` for `email`, `/memory` appeared in its palette and `/help`, and `FetchMemory` sailed through the contract gate to GET a route that does not exist. Version answers *"is this build new enough"*, never *"does this agent have the route"* — both have to hold. The gate now pairs the floor with the agent that owns the memory store, the same way `/model` is already scoped in `modelcmd.go`. Asking for memory on an agent that keeps none now says exactly that, instead of telling the user their perfectly current agent is out of date. <details> <summary>🔍 Why no test caught it, and three smaller repairs</summary> **The test suite was aimed at the wrong agent.** `fakeRelay.client()` builds an `SSEClient` named `email` (`sse_test.go`), so *every* memory test was exercising an agent with no memory route and passing anyway, because the gate never looked at the id. Those tests now use the flagship id via a new `clientFor(t, id)`, and the `email` case is pinned by a test that fails against the shipped gate. - **`Supports` claimed to know about capabilities it had never heard of.** The `default:` branch returned `(false, true)` — a confident "unsupported" — so the next capability added would be hidden by whichever transport was not taught about it, with nothing on screen saying why. That is precisely what the tri-state exists to prevent. Unknown is the honest answer. - **`AgentVersion` decoded only `version`.** That is the flagship's spelling; `email`'s `/v1/email/version` and *both* agents' top-level `/version` say `agentVersion`, so the release version was permanently blank for `email` and amd#3979's live-refinement never fired there. It accepts both spellings now, preferring `version`. - **The agents panel matched a late load result by comparing interface values**, which panics at runtime if the dynamic type is uncomparable (a `HubAgentLister` passed by value with a slice or map field). A generation counter does the same job with no such edge. Also folded in: a `gofmt` misalignment in `chat/model.go` that shipped in amd#3987, and a test pinning the `/help` Commands block at exactly two lines — `renderCommandsSection` skips the continuation *by position*, so a third line would silently leak into every filtered render. </details> ## Test plan - [x] **Mutation-verified** — reverting the gate to the shipped version-only form turns the new test red, and restoring it turns it green: ``` === with the fix reverted === --- FAIL: TestSupportsMemoryIsScopedToTheAgentThatHasTheRoute capability_test.go:254: an agent with no memory route must not report the memory capability, whatever its contract number === restored === ok github.com/amd/gaia/tui/internal/client 0.007s ``` - [x] `go build ./...`, `go vet ./...`, `gofmt -l ./internal` all clean (Go 1.26.3, Linux) - [x] `go test ./... -count=1` green — 22 packages, 0 failures (`-skip TestCtrlVReadsTheClipboard`, which reads the machine's real clipboard) - [x] New regression tests: `email` refused despite 2.14; the refusal is not an `ErrMemoryContractTooOld`; an unknown capability reports unknown on both transports; `AgentVersion` accepts both wire spellings; an abandoned load cannot overwrite the current list No Python or docs changes — the sidecar route and its contract are unchanged.
Main's allowlist fixes (amd#3593) keep refusing under this branch's ask-first model: each guard it added is tagged as an outright refusal, so none of them turns into a yes/no prompt. The /agents switch (amd#3987) and the conversation-clear test (amd#3650) now use the full-access names, and a saved-default notice is shown once rather than again on every switch.
On any machine that followed the documented install path — the installer from amd-gaia.ai, then the
gaia initthe installer tells you to run —/memoryansweredThis agent does not support /memory.while the palette,/helpand the docs all advertised it.gaia inithub-installs the flagship, which moves it to the daemon transport, and the memory dump only ever existed over stdio. It works on both install shapes now. The chat also never said which agent was answering (the flagship's name is literally "GAIA", so it was suppressed as a duplicate of the product word) — the header names it, with the id--agentactually takes. And/agentslists the agents installed on the machine and switches to one without leaving the TUI.Closes #3978 · Closes #3979 · Closes #3980
Proof, on a real machine
t-nx-strx-halo(Ryzen AI MAX+ 395, Ubuntu 24.04, Go 1.26.3, Lemonade 11.0.0), driven through the TUI's loopback control API against a genuinely hub-installed flagship on the daemon transport — the exact broken state — in an isolated$HOMEso nothing of the real install was touched.The sentinel that decides the transport (this is the broken configuration)
{"id":"gaia","version":"0.2.0","language":"python","artifact_kind":"binary","executable":"gaia-agent", "path":"/tmp/gaia-drive/home/.gaia/agents/gaia"}"artifact_kind": "binary"is what flips the flagship off its seededTransportSubprocess(catalog.go:512). Readiness gate, all four rows green, agent running as a daemon-supervised sidecar:/memory— three facts planted in the store, retrieved through the new route. Before this change this frame readThis agent does not support /memory.The route itself, against a live sidecar —
200in 43 ms:The header and footer now name the agent (was
GAIA │ Gemma-4-E4B-it-GGUF— no agent segment at all):/agents, and a switch that can be backed out of:Selecting
emailre-runs the readiness gate for it (view=preflight, agent=email);Escreturns to the livegaiasession rather than quitting the program —{'view': 'chat', 'agent': 'gaia', 'overlay': None}— with the outcome visible in the transcript:Two bugs this evidence caught that tests did not
Both were found by driving the real binary, and both now have regression tests:
/agentspanel was never taken off screen after a selection.agents.ModelemitsSelectedMsg, neverClosedMsg, and onlyClosedMsgclearedagentsPanel— so the four non-switching outcomes wrote their status line behind the panel. The flagship sorts first withselectedat 0, so the single most likely first interaction — opening/agentsand pressing Enter — read as a dead key.Updatetreated a cancelled context as death, so a panel the host re-showed after an abandoned switch swallowed every key including Esc.A
p-at-the-switch-gate bug (re-launching the outgoing agent with a transcript claiming it switched) came out of an adversarial review pass and was reproduced with a compiled Go test before being fixed.Test plan
go build ./... && go vet ./...clean (Go 1.26.3, Linux)go test ./... -count=1green — 22 packages, 0 failures (-skip TestCtrlVReadsTheClipboard, which reads the machine's real clipboard)pytest hub/agents/gaia/python/tests— 339 passed, including 6 new tests forGET /v1/gaia/memorypytest tests/unit— 43 pre-existing failures, byte-identical to an unmodifiedorigin/mainbaseline run on the same box;commof the two failure lists shows zero unique to this branch, and +6 passingpython util/lint.py --black --isortclean ·util/check_doc_links.pyclean ·bash -n installer/scripts/install.shclean/memory,/agents, agent switch, switch cancel,/palette and/help— output aboveWhat is deliberately not in here
/modelhas the same gap and is not fixed here — #3985.run_model_commandexists only ingaia_agent/stdio.py; the sidecar's HTTP surface has no equivalent, so on a hub-installed flagship/modelis still answered by the LLM as prose. It is left advertised rather than half-gated: hiding it would trade a wrong answer for a missing feature on exactly the machines #3978 is about, and the real fix is a sidecar route. Verified by reading the code and independently by a reviewer.Two deviations from the issue text, both deliberate:
m.client.(client.MemoryProvider). Once*SSEClientimplements that interface the assertion succeeds for both transports and discriminates nothing, so the gate is a contract-version capability instead (client.CapabilityReporter). Same outcome, and it keeps working as more transports appear.gaia hub install <id>remains the Python CLI's job.#1173 / #1174 / #1175 triaged and closed as superseded — they describe the browse/detail/lifecycle screen #3120 removed by design, not this.
Docs updated together, per the bundled-docs rule:
docs/guides/terminal-hub.mdx(the "nothing to browse and nothing to pick" warning was no longer true),docs/guides/memory.mdx,docs/guides/mcp/tui.mdx, and the hub package'sREADME/SPEC/SKILL/CHANGELOGfor contract 2.13.