Skip to content

fix(agent): keep the system prompt fixed so local turns stay cached - #4698

Merged
kovtcharov-amd merged 10 commits into
amd:mainfrom
kovtcharov:kalin/prompt-prefix-stable
Oct 5, 2026
Merged

kovtcharov-amd merged 10 commits into
amd:mainfrom
kovtcharov:kalin/prompt-prefix-stable

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

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:

  • Learned procedures recalled for the current goal were written into the system prompt, so it was rebuilt every time the match 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 recompose. A fact extracted after the last turn, an auto-stored tool error, or a confidence bump therefore changed the prompt. That includes the rebuild index_document still 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. A forget or update_memory of an item it shows still takes effect immediately.
  • The skill filter recomposed the prompt whenever the always-on gaia-voice skill 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.py plus 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 agent on gaia_memory, memory, gaia_rag, context_retention, on this branch and on main, same machine. This changes prompt assembly, so CLAUDE.md requires it.
  • Re-run the RC TUI walkthrough and check lemond.log. No step after an index_document should start from progress = 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 + tools payload from the real GaiaAgent. 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:

cause first diverging content
indexed docs (#4571) **CURRENTLY INDEXED DOCUMENTS:**\nNo documents are currently indexed. → You have 1 document(s) already indexed…, at the step after index_document
recalled procedures ==== LOADED SKILLS (active this turn) ==== → === RECALLED PROCEDURES (learned from past successful runs) ===, on every turn whose match changed
memory drift No memories stored yet. → Known facts:\n - Sam works on the safety team (confidence: 0.50…), then 0.50 → 0.52 the turn after
no-op skill recompose _refresh_active_skill_filter going [] → ['gaia-voice'] → [], recomposing on each flip (the trigger for the drift above)
dynamic tools (#4554) tools payload: -[clear_code_index, get_index_status, …] +[bookmark, find_files, …] on every new turn

Why ordering didn't help. VOLATILE_PROMPT_FRAGMENTS puts 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:

  • Qwen3.6 thinking: the chat template drops reasoning_content from 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 needs preserve_thinking plus 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_items join the tool list only on "extract every X" turns.
  • User-loaded skill bodies still toggle in the system prompt (the fix(email): ship with Agent Skills off until the eval gate covers them #2848 size trade-off).
  • The project map's index-status line still changes, but only when something else recomposes.

Also: three pre-existing except …: pass handlers in the touched files now log instead of swallowing.

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.
@github-actions github-actions Bot added documentation Documentation changes tests Test changes agents labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • Run the agent eval. This changes prompt assembly and the document-handling rules on every turn, and the eval item in the test plan is still unchecked. Run gaia_rag, gaia_memory, memory and context_retention (via eval_flagship.yml if no Strix Halo is free), compare against the flagship baseline, and post the PASS→FAIL / FAIL→PASS lists.
  • The new "no line means nothing is indexed" rule contradicts itself when the model indexes a file mid-turn. The document list is built when the turn starts, so after the model indexes a file itself, the latest user message still says nothing is indexed. The rule then says "do NOT query", while the existing post-index rule says "query next". The framework's re-ask guard catches this, but only after a wasted step. On a small model it is exactly the kind of conflict the eval should test. Adding one clause to the rule fixes it (see details).

Real-world evidence

N/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 lemond.log, answer quality) needs real inference on the strix-halo lane. The author's TUI re-run item is also still open. This verdict rests on static review and the PR's captured-request test.

🔍 Technical details

🟡 Required eval not run (CLAUDE.md, "Run agent evals when changing LLM-affecting code paths")
The diff touches ChatAgent._get_system_prompt() (the indexed-docs section is rewritten, and the Tier-2 RAG rules are now always present instead of gated on has_indexed), procedural recall placement, and VOLATILE_PROMPT_FRAGMENTS. Every one of these is on the must-eval list. Note also that rag_query_rules now ships on every doc/full turn, which grows the cold prompt for sessions that never index anything. The eval should confirm that costs no quality on the non-RAG categories.

🟡 Mid-turn index conflicts with the new rule (hub/agents/chat/python/gaia_agent_chat/agent.py:1022)
_indexed_documents_line() is evaluated once, in MemoryMixin.process_query (src/gaia/agents/base/memory.py:2985), before the loop starts. After the model calls index_document within the same turn, the system prompt and the latest user message still carry no [Indexed documents: …] line. The rule "With no such line in the latest message, nothing is indexed … do NOT call query_documents or query_specific_file" then directly contradicts the POST-INDEX QUERY RULE (agent.py:1128). The re-ask guard around src/gaia/agents/base/agent.py:8861 repairs it, but at the cost of an extra model step (your own test scripts exactly that re-ask). Suggested wording:

When documents are indexed, the user's message includes a line `[Indexed documents: ...]`. The one in the latest message is current — you never need to check what is indexed. A document you indexed yourself with `index_document` during this turn is indexed even though that line doesn't list it yet: follow the POST-INDEX QUERY RULE. Otherwise, with no such line in the latest message, nothing is indexed: answer general questions and greetings from your knowledge, use the SMART DISCOVERY WORKFLOW below for domain-specific questions, and do NOT call query_documents or query_specific_file.

🟢 test_indexed_docs_per_turn.py lacks the SPDX header the sibling new test carries. Ignore if intentional; this is only for consistency.

Strengths

  • test_prompt_prefix_stability.py captures the real outgoing requests and asserts a prefix property, not "rebuild was called". It catches every cause listed in the PR body, including the memory drift that perf(chat): name indexed documents per turn, not in the system prompt #4571 alone would have reintroduced.
  • _refresh_if_shown keeps forget/update semantics correct without paying a recompose for items the prompt never showed, and the tests pin both branches.
  • The except …: pass handlers in touched files now log at debug, in line with the fail-loudly rule.

…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.
@github-actions github-actions Bot added the devops DevOps/infrastructure changes label Oct 5, 2026
…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.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 5, 2026
Merged via the queue into amd:main with commit e0ed41d Oct 5, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/prompt-prefix-stable branch October 5, 2026 01:36
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 5, 2026
… 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.
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 5, 2026
…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]>
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Oct 5, 2026
…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]>
aksh8b pushed a commit to aksh8b/gaia that referenced this pull request Oct 5, 2026
…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]>
@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]>
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 12, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents devops DevOps/infrastructure changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants