Repository navigation
fix(agent): keep the system prompt fixed so local turns stay cached - #4698
Conversation
Indexing a document rebuilt the system prompt, and the list sat right after the base prompt, so the next request re-read the whole ~19K-token prompt: 68 s and 57 s of prompt processing on the two document questions of a new user's first session (Gemma-4-E4B, Radeon 8060S). The rules for indexed documents are now fixed text, and the current set is sent with each turn as [Indexed documents: ...], the way memory's dynamic context already is.
The RAG answering rules were held back until the first index to keep the prompt short (amd#1030); that gate is what re-read the whole prompt mid-turn. They are now read once at warm-up.
With memory on, the per-turn line follows the time context rather than leading the message, and replayed turns carry older lines.
On a local model a turn could stall for minutes while the server re-read the whole conversation: llama.cpp reuses only the prefix two requests share, and on Gemma 4 (sliding-window) and Qwen3.6 (hybrid) any change to the system prompt or tools discards everything after it. Three things still rewrote the system prompt mid-session once amd#4571 moves the indexed-document list out of it: - Learned procedures recalled for the current goal were composed into the system prompt and rebuilt whenever the matched set changed. They now ride in the turn's [GAIA Memory Context], next to recalled memories. - The "stable" memory section was re-read from the store on every recomposition, so a fact extraction stored after the last turn, an auto-stored tool error, or a confidence bump changed the prompt the next time anything recomposed it -- including the rebuild that index_document still triggers. It is now rendered once per session, as the memory docs already promised, and re-rendered on a context switch, a session reset, or a forget/update_memory of an item it shows. - The skill-body filter recomposed the prompt whenever the selection list changed, even when only an always-on skill (gaia-voice, scored near the threshold) flipped in it and the rendered bodies were identical. test_prompt_prefix_stability drives the real flagship through the stdio history path with the model call captured -- a tool call, an index_document, a recalled procedure, a fact stored between turns and a guard re-ask -- and asserts every request extends the one before. It fails on main and on amd#4571 alone at the first new turn. Also logs, instead of swallowing, three pre-existing except/pass handlers in the touched files.
|
Verdict: Request changes. The code is sound; what's missing is the agent eval CLAUDE.md requires for prompt changes, and one new document rule could misfire. This PR keeps the system prompt byte-stable across a session, so a local model can reuse its cache instead of re-reading the whole conversation. Recalled procedures and the list of indexed documents now travel with each user turn. The memory section is rendered once per session. A skill flip that changes nothing on screen no longer triggers a rebuild. The new end-to-end test, which fails on main, shows every request extending the one before it. The frozen-memory rules hold up: forgetting or editing a memory the prompt shows still takes effect immediately. Two things to fix before merge:
Real-world evidenceN/A: no evidence bundle was produced for this run. The change is prompt assembly inside the agent loop, and its real effect (cache reuse in 🔍 Technical details🟡 Required eval not run (CLAUDE.md, "Run agent evals when changing LLM-affecting code paths") 🟡 Mid-turn index conflicts with the new rule ( 🟢 Strengths
|
…le directive check test_prompt_prefix_stability.py required a real RAGSDK (pypdf/faiss) to monkeypatch index_document, but the Gaia Agent Tests CI lane installs no RAG extras -- agent.rag was None there, failing at fixture setup. The test only pins request-prefix stability, not retrieval correctness, so it now stubs agent.rag directly via the public setter. test_chat_system_prompt_directives_preserved pinned the literal phrase "currently indexed documents", which this PR intentionally dropped -- the per-turn indexed-doc list now rides in get_memory_dynamic_context() so the static heading no longer needs the word "currently". Updated the pinned phrase to match; the substantive RAG directives it guards are unchanged.
tests/unit/test_indexed_docs_per_turn.py (added by this PR) imports gaia_agent_chat at module level but wasn't named by any workflow's pytest invocation, so it skipped wholesale everywhere and check_module_skips.py failed Unit Tests (Linux, py3.12) with "not in module_skips". Added it to test_chat_agent.yml's Chat-Wheel Suites step (same lane as its sibling prompt-composition tests) and to the allowlist's reason entry for that lane.
…e expects The stub lacked chunks/file_metadata/file_to_chunk_indices and a _retrieve_chunks_from_file override, so the agent's post-index query guard (forces query_specific_file when an answer skips retrieval after indexing) hit a raw AttributeError against the fake instead of the "no relevant information found" reply a real empty RAGSDK would give. That let the guard's error path leak into later turns on CI, in one run dropping the per-turn "[Indexed documents: ...]" line it was supposed to preserve.
…me-dir default GaiaAgentConfig.allowed_paths defaults to the user's home directory (unlike ChatAgent, which defaults to cwd) -- see its field comment in gaia_agent/agent.py. The fixture's handbook.md lives under pytest's tmp_path, which nests under $HOME on this Windows box but sits under /tmp on the Linux CI runner, outside $HOME. index_document and read_file were therefore refused there with "not in allowed paths" -- silently masked locally, reproducing on every CI run. Pass allowed_paths=[str(work)] explicitly instead of relying on the default.
… prompt The missing-dependency line re-checks after an install, so it changed the system prompt mid-session, and a granted folder changed the work-roots line the same way. Either change makes a local model re-read the whole conversation (amd#4698). The dependency line now rides in the user turn, next to the indexed-documents line, so it stays current. The work roots are fixed at the first render; a later grant still applies, only the line lags it. A flagship test runs two turns with an install and a grant between them and checks the prompt does not change while the turn carries the update.
…remember' (amd#4708) On the v0.25 RC (local Qwen3.6-35B-A3B) the `gaia_memory` eval failed three scenarios. The agent apologised for "losing" things the user never told it and made up a lost-session excuse. It deleted a salary on request and then repeated it, along with 30% of it, straight from the chat history. And it acknowledged "remember my favourite colour is teal, just acknowledge" without calling `remember`. With this change the memory guidance covers each case: it checks memory first and says plainly the thing was never mentioned, it treats deleted info as off-limits for the rest of the session, and it always calls `remember`. A successful `forget` now also reminds the model of that in its tool result. The new text is static, so the prompt prefix stays stable and the per-session memory freeze from amd#4698 still applies. The memory instructions grow by 347 chars (~87 tokens). I cut one redundant greeting example to help pay for it. ## Test plan - [ ] `gaia eval agent --category gaia_memory` before and after (required: this is an LLM-affecting prompt change). Check that `mem_false_premise_recall`, `mem_forget_then_probe` and `mem_store_recall_basic` pass and that the rest of the category doesn't regress - [x] `pytest tests/unit/test_memory_mixin.py tests/unit/test_memory_prompt_growth.py tests/unit/test_system_prompt_composition.py tests/unit/test_prompt_size_budget.py tests/unit/test_tool_description_budget.py hub/agents/gaia/python/tests/test_prompt_prefix_stability.py hub/agents/gaia/python/tests/test_server_memory.py hub/agents/gaia/python/tests/test_memory_dump.py` - [x] `python util/lint.py --black --isort` --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
…md#4532) On Qwen3-30B the flagship often answered without looking. It described `toybox/dates.py` without opening it, said the file "doesn't exist" without a search, showed CSV rows no tool had produced, and wrote "the fix is complete and tested" with no test run. The task-eval judge scored its truthfulness around 2.7/5. Now the agent loop checks the answer against what the turn's tools actually did before the answer counts. It asks for one correction per check: "You haven't read `toybox/dates.py` (it is at `…`) — read it now, or say you didn't." If the gap survives, the answer ships unchanged, and the gap becomes one more reason in the same "I haven't confirmed this works — …" note amd#4508 adds, never a second note. It is never rewritten. On the same five tasks, Qwen's truthfulness rose from 2.72 to 3.33 and its pass rate from 5/25 to 9/15. The gain is larger than the run-to-run spread, but the ranges nearly touch (2.40–3.20 before, 3.00–3.80 after), so read it as a real but modest improvement from small samples. On DeepSeek V4.1 Flash no grounding check fired in any run. | Model · tasks `21-qa, 11-codereview, b6-weekly-report, b6-config-env, 02-bugfix` | Truthful (min–max) | Passed | Quality | Steps / run | Tokens / run | |---|---|---|---|---|---| | Qwen3-30B, `main` (5 runs) | 2.72 (2.40–3.20) | 5/25 | 2.04 | 25 | 220K | | Qwen3-30B, this PR (3 runs) | **3.33** (3.00–3.80) | **9/15** | 3.10 | 29 | 262K | | DeepSeek V4.1 Flash, `main` (2 runs) | 4.90 | 10/10 | 4.90 | 44 | 641K | | DeepSeek V4.1 Flash, this PR (2 runs) | 4.80 | 10/10 | 4.57 | 47 | 713K | - Qwen's gain comes from the two tasks it used to answer blind: `21-qa` went from 0/5 to 3/3 passes and `11-codereview` from 1/5 to 3/3. `b6-config-env` still fails every time; that failure is the implementation, not truthfulness. - DeepSeek's small dips come from `11-codereview`: the judge docked an edit to `tests/test_dates.py` that nobody asked for, caught by the existing completion check. No grounding check fired, so they are not caused by this change. - An earlier revision on this branch only reached 2.87 on Qwen: after the correction the model read the file from the wrong folder, and that failed read counted as "looked". The second commit fixes it: only a successful read counts, and the correction says where the file is. <details> <summary>🔍 Technical details</summary> - `gaia.agents.base.grounding` is pure and dependency-free, like `claims.py`. It has three checks over `_turn_tool_executions`, which now also carry `observed`, the flattened text of each tool result, capped at 400K characters. - **look**: the request names a file that exists or a snake_case symbol, and no successful read named it. Also, in such a turn, a "does not exist" claim with no lookup on record. - **content**: values in a table or an untagged/CSV/JSON block that appear in no tool output, tool argument, or earlier user or tool message. Decimals, dates and percentages in the surrounding prose are checked too. One arithmetic step from two values the answer shows still counts as supported. Small whole numbers, versions and estimates are skipped. The check stays silent when no tool ran. - **action**: the answer says searched, read, ran, tested, verified or documented something, and no tool of that kind ran. Negation is judged per clause. Advice, conditions and descriptions ("it is tested on every PR") are not claims. - `claims.py` gains `action_claims`, `absence_claim` and `admits_unverified`. "Still" is no longer a negation word, so "existing tests still pass" is now a test claim. This also affects the code benchmark's `claims_success`. - Loop wiring: - Corrections go out only before the turn is marked answered; after that the scope guard would refuse the lookup. - Each check corrects at most once per turn. - Surviving gaps are marked at seal time. Early exits that didn't end on an error get the same marking. - Earlier assistant messages are not counted as evidence. - Offline replay over 151 past `gaia eval tasks` answers: the checks fire on 34 of 78 Qwen answers the judge scored 3 or below, on 0 of 34 well-scored DeepSeek answers, and on 1 of 38 well-scored Qwen answers. That one is a PR review answered without opening the file. The remaining misses are wrong reasoning, which a check against the tool record cannot see. - Measurement conditions: - Runs were serial and interleaved before/after on one machine and one embedded Lemonade, with the judge `claude-opus-5-5`. - No standby events occurred during the runs. - There is no committed flagship baseline for `gaia eval agent`, so this PR reports task-eval numbers rather than a scorecard verdict. </details> ## Test plan - [ ] `python -m pytest tests/unit/agents/test_grounding.py tests/unit/agents/test_unsupported_test_claim.py tests/unit/agents/test_cut_off_reply_guard.py tests/unit/eval/test_behavior_harness.py` - [ ] `python util/lint.py --black --isort --flake8` - [ ] `gaia eval tasks run --suite everyday --model Qwen3-30B-A3B-Instruct-2507-GGUF --tasks 21-qa,11-codereview,b6-weekly-report,b6-config-env,02-bugfix`, then `gaia eval tasks judge <dir>`: transcripts show `[check:grounding]` corrections, and truthfulness sits above main's 2.72. - [x] `pytest hub/agents/gaia/python/tests/test_prompt_prefix_stability.py` (the cached-prefix test from amd#4698) passes with main merged - [ ] `gaia eval agent --category gaia_core` and `gaia eval agent --category gaia_honesty` --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
…where the agent may work (amd#4537) Agents found out one failed step at a time that the project could not import here and that paths outside the workspace are denied: pip probes, site-packages hunts, `cd C:\` and similar. GAIA now states both up front. Each turn says which runtime dependencies the manifest declares are missing from the `python` on PATH, with nothing from the project imported or run, and the project map names the folders the agent may use. The dependency line rides in the turn, not the system prompt: an install changes it mid-session, and a changed system prompt makes a local model re-read the whole conversation (amd#4698). The table below was measured with the line in the system prompt. | 6 hard SWE-bench tasks, DeepSeek V4.1 Flash | without (2 runs) | with | |---|---|---| | "Access denied" hits | 8, 7 | **0** | | Environment-probing calls | 17, 16 | **11** | | Repeated failures | 6/22, 5/23 | 1/11 | | Steps | 215, 233 | 204 | | Cost | $0.52, $0.68 | $0.49 | | Solved | 2/6, 3/6 | 2/6 | ## Test plan - [x] `python -m pytest tests/unit/agents/test_project_deps.py tests/unit/test_project_map.py hub/agents/gaia/python/tests/test_prompt_prefix_stability.py hub/agents/gaia/python/tests/test_prompt_prefix_stability_project_deps.py`: an install and a folder grant between two turns leave the system prompt byte-identical, and the second turn says the dependencies are installed (fails before the fix) - [ ] In a checkout whose `pyproject.toml` names an uninstalled package, the user turn carries `[Python dependencies NOT installed for `python`: …]` - [ ] `gaia eval agent --category gaia_core` --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
# 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]>
…d#5038) Long conversations silently dropped their oldest turns from the model's context — only a backend log line recorded it — so GAIA could "forget" early details with no sign. Now the Agent UI and the TUI show one quiet line at the turn where it happens: "Older messages are now out of the model's view (N turns). Ask me to recall them if you need them." It appears once per cut, not every turn. What is sent to the model, the history budget, and prompt text are unchanged, so prefix/KV-cache stability (amd#3629, amd#4698) is untouched and no eval re-run is needed. ## Test plan - [x] `pytest tests/unit/agents/test_model_history.py tests/unit/chat/ui/test_model_history.py hub/agents/gaia/python/tests/test_stdio.py hub/agents/gaia/python/tests/test_stdio_wire_contract.py` — a cut emits exactly one notice with the right count, no cut emits none, the stdio event matches the shared wire fixture - [x] `cd tui && go vet ./... && go test -count=1 ./internal/...` (CGO off) — the notice lands in the transcript, not the live work log - [x] `npm test` + `npm run build` in `src/gaia/apps/webui` — inline note while streaming, kept on the finished turn and after a message refetch - [x] Agent UI end-to-end with a forced 60-token history budget and a stubbed model: note rendered inline before the reply - [ ] Reviewer: a live TUI session over a long chat (covered by the Go render test, not driven live) <details> <summary>🔍 Technical details</summary> - `select_history(..., on_cut=)` reports `HistoryCut(turns, tokens)` only when the newest turn increased the hidden count. It is stateless, so a restart doesn't re-announce. - TUI: `status` gains a `history_cut` stdio extension (wire fixture and spec §10.3 updated). Agent UI: a `status` event with `status: "history_cut"`. - Known limit: the Agent UI note is client-side only, so a page reload drops it. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
On a local model, a turn could stall for minutes while the server re-read the whole conversation from the first token: 34,100 tokens (155 s) and 39,531 tokens (240 s) in the v0.25 RC TUI session on Gemma-4-E4B. llama.cpp reuses only the prefix two requests share. On Gemma 4 and Qwen3.6, any change to the system prompt or tool list throws away everything after it. GAIA still rewrote the system prompt mid-session for things that change every turn. This PR moves that content into the turn, so each request extends the one before it.
Stacked on #4571. Merge that first. It fixes the cause behind both RC stalls: indexing a document rewrote the system prompt, and the next step re-read everything. This branch includes its commits until then. Even with #4571, three causes still rewrite the prompt:
[GAIA Memory Context], next to recalled memories.index_documentstill triggers under perf(chat): name indexed documents per turn, not in the system prompt #4571, so perf(chat): name indexed documents per turn, not in the system prompt #4571 alone breaks again once memory extraction runs. The section is now rendered once per session, which is what the memory docs already promised. Aforgetorupdate_memoryof an item it shows still takes effect immediately.gaia-voiceskill flipped in the selection, even though its body renders either way. Each needless recompose is what carried the memory drift in.Per-turn tool selection, the remaining cause, is #4554 (already in the RC). The new test pins
dynamic_tools=False.Test plan
pytest hub/agents/gaia/python/tests/test_prompt_prefix_stability.py: builds the real flagship with the model call captured and runs four turns through the stdio history path. The turns cover a tool call,index_document, a recalled procedure, a fact stored between turns, and the RAG guard's re-ask. Each of the 7 requests extends the one before. Fails on main and on perf(chat): name indexed documents per turn, not in the system prompt #4571 alone at the first new turn.pytest tests/unit/test_memory_mixin.py(331 passed, including new frozen-section tests: mid-session writes stay out, forgetting a shown memory removes it at once, forgetting an unshown one costs no recompose).pytest tests/unit/test_agent_lazy_skill_prompt.py tests/unit/test_indexed_docs_per_turn.py tests/test_chat_agent.pyplus the other skill, memory and prompt-composition suites all pass.pytest hub/agents/gaia/python/tests: 604 passed. The 3 failures also fail on main (optional browser extra not installed).gaia eval agentongaia_memory,memory,gaia_rag,context_retention, on this branch and on main, same machine. This changes prompt assembly, so CLAUDE.md requires it.lemond.log. No step after anindex_documentshould start fromprogress = 0.0x, and new turns should re-read only the new turn.🔍 Technical details
How each cause was found. A scratch harness captured every outgoing
messages+toolspayload from the realGaiaAgent. It rendered each payload the way the chat template lays it out (system, tools, then turns) and reported the first diverging byte between consecutive requests:**CURRENTLY INDEXED DOCUMENTS:**\nNo documents are currently indexed.→You have 1 document(s) already indexed…, at the step afterindex_document==== LOADED SKILLS (active this turn) ====→=== RECALLED PROCEDURES (learned from past successful runs) ===, on every turn whose match changedNo memories stored yet.→Known facts:\n - Sam works on the safety team (confidence: 0.50…), then0.50→0.52the turn after_refresh_active_skill_filtergoing[]→['gaia-voice']→[], recomposing on each flip (the trigger for the drift above)-[clear_code_index, get_index_status, …] +[bookmark, find_files, …]on every new turnWhy ordering didn't help.
VOLATILE_PROMPT_FRAGMENTSputs changing fragments last in the system text. The template renders the tool declarations after the system text, though, so a change there still invalidates ~10K tokens of tools plus all history. And Gemma 4 (sliding-window) and Qwen3.6 (hybrid) can resume only from a llama.cpp checkpoint, which sits near the end of an earlier prompt, never at that boundary. In the RC log that shows up as 0% reuse.Not changed here, for follow-up:
reasoning_contentfrom messages before the last user turn, so each new turn re-reads the previous turn's tool steps. The RC log shows 4–7K tokens per turn. Fixing it needspreserve_thinkingplus re-sending reasoning, which is a design call. Gemma isn't run with thinking on, so it isn't affected.extract_document_items/save_extracted_itemsjoin the tool list only on "extract every X" turns.Also: three pre-existing
except …: passhandlers in the touched files now log instead of swallowing.