Skip to content

test(relay): give the fake sidecar agents a path validator - #8393

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:test/relay-fakes-path-validator
Nov 17, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:test/relay-fakes-path-validator

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Eight relay tests are failing on main again. #8375 made the agent check a document's file permission on every turn, and the fake agents in these tests had no permission checker. Production is unaffected, because the real agent always has one. CI didn't notice because it skips these tests (#8392 tracks making it run them).

Test plan

  • pytest tests/unit/test_relay_always_allow.py tests/unit/test_relay_flagship_tool_history.py tests/unit/test_relay_followup.py tests/unit/test_relay_flagship_documents.py with the flagship installed: 79 passed (8 failed on main)

amd#8375 made the sidecar read agent.path_validator on every turn, and the
fake agents in three relay test files had none, so 8 tests failed again
wherever they run. CI skips them, which is how it went unnoticed.
@github-actions github-actions Bot added the tests Test changes label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

This PR only changes tests. It gives the fake agents in three relay test files the file-permission checker that the real agent always has. Last turn's change (#8375) made the sidecar use that checker on every turn that carries documents, so these fakes started crashing. This is the right fix, and production code is untouched.

The real gap is the one the description already names: CI skips these tests, so a break like this one reaches main without anyone seeing it. #8392 tracks that work, and closing it is what stops this from happening again.

Real-world evidence

N/A. This PR changes tests only and touches no user-facing surface. No evidence bundle was produced, and the verdict rests on static review. I couldn't re-run the tests here because this runner has no pytest installed. The author's test plan reports 79 passed, against 8 failures on main.

🔍 Technical details

Issues found: none blocking.

  • 🟢 Other relay fakes lack the attribute. _AskingAgent and the two _GatedAgent fakes (test_relay_flagship_question.py, test_relay_full_access.py, test_relay_tool_confirmation.py) still have no path_validator. That is safe today: _drop_detached_documents (hub/agents/gaia/python/gaia_agent/server.py:1070) is reached only when request.documents is not None (server.py:2013), and those tests don't send documents. A future test that adds documents to them will hit the same AttributeError this PR fixes.
  • Note: _drop_detached_documents reads agent.path_validator directly, while its siblings in src/gaia/ui/ use getattr(..., None). For the sidecar the direct read is correct, because ChatAgent always builds a validator and skipping the grant revocation without a word would be a silent fallback. Fixing the fakes is the right side to change.

Strengths

  • The fakes use a real PathValidator([]) rather than a MagicMock, so remove_allowed_path / release_path / withhold_path run with their real behaviour instead of being stubbed away.
  • An empty allowlist sets _use_persisted_grants = False, so the fakes never read the machine-global allowed_paths.json. The root conftest.py already sends GAIA_HOME to a temp folder.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 17, 2026
Merged via the queue into amd:main with commit 987fabf Nov 17, 2026
26 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the test/relay-fakes-path-validator branch November 17, 2026 17:24
@kovtcharov-amd kovtcharov-amd mentioned this pull request Nov 17, 2026
kovtcharov-amd added a commit that referenced this pull request Nov 17, 2026
# GAIA v0.26.1 Release Notes

## Summary

- Changing the model server, connectors or skills in Settings now takes
effect in chats that are already open, including the terminal UI.
- "Am I free?" no longer says yes when an Outlook meeting's time can't
be read.
- A chat on a cloud model is no longer offered a large local download.
- After an agent crash, the next message gets a fresh answer instead of
the old one continued.
- 11 PRs merged since v0.26.0.

## What's New

- **Settings reach open chats** — a model server, connector or skill
change applies on the chat's next message, in the Agent UI and the
terminal UI. The terminal UI and `gaia -p` now offer only the MCP
servers turned on for GAIA. (PRs
[#8389](#8389),
[#8394](#8394),
[#8399](#8399),
[#8400](#8400))

## Bug Fixes

- **Outlook availability is no longer guessed** — a meeting whose time
can't be read is reported instead of skipped, and Outlook times parse on
Python 3.10. (PR [#8267](#8267))
- **No unwanted local download on a cloud model** — Settings › Manage
downloads leaves the local chat model unticked while chat runs on a
cloud model. (PR [#8086](#8086))
- **A reply cut short by a crash isn't continued** — the next message is
answered fresh. (PR [#8391](#8391))
- **A command's timeout never outlasts the turn's time limit.** (PR
[#8424](#8424))
- **An MCP connector shows Connected only after a check has started
it.** (PR [#8434](#8434))
- **A document overlap of 0 repeats nothing between chunks.** (PR
[#8382](#8382))
- **Closing the resource strip says how to bring it back.** (PR
[#8432](#8432))
- **A release candidate names its own pre-release as the agent's
source.** (PR [#8433](#8433))
- **The "GAIA doesn't run this model server" line is translated in
Arabic.** (PR [#8435](#8435))
- **Relay tests run against fake agents that match the real one.** (PR
[#8393](#8393))

## Full Changelog

**11 PRs** since v0.26.0. The PR links above are the changelog.

Full Changelog:
[v0.26.0...v0.26.1](v0.26.0...v0.26.1)
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Nov 17, 2026
… down (amd#8436)

With the app pointed at a model server GAIA doesn't run
(`LEMONADE_BASE_URL`, or "use my server") and that server down, a
message waited about a minute and then said the model "may be loading or
briefly busy — try sending the message again". Retrying could never
help. The chat now ends in a few seconds and says what the banner says:
the model server at that address isn't answering, start it, then send
again.

Closes amd#8343

**Evals:** no prompt, tool or classification change; the turn raises the
existing server-down error earlier. `tool_calling` and `rag_quality` are
the categories the issue named to watch on the next RC.

## Test plan

- [x] Live, source backend on an isolated profile with
`LEMONADE_BASE_URL` at a closed port: a local-model chat went from 56 s
and "briefly busy" to 5.9 s and "The local model server at
127.0.0.1:59999 isn't answering…"; a cloud-model chat from 10.7 s and
"briefly busy" to 5.9 s with the same message
- [x] `python -m pytest
tests/unit/chat/ui/test_users_server_down_fails_at_once.py` — 5 new
tests, one through a real streamed turn
- [x] `python -m pytest tests/unit -n 8` — 47,199 pass; the only 10
failures are the relay tests already failing on main (amd#8392, fixed by
amd#8393)
- [ ] Reviewer: in the desktop app with "use my server" set and that
server stopped, a message fails within a few seconds with the new text
(checked on the source backend only)

<details>
<summary>🔍 Technical details</summary>

- `_refuse_turn_on_stopped_users_server` runs first in the streamed
turn's worker, before the warm-up wait and agent construction, so both
the in-process and the relayed paths get it. It only acts when
`configured_lemonade_url()` is set, so GAIA's own server keeps its
restart path.
- The unit suite plants `LEMONADE_BASE_URL=http://127.0.0.1:1` (and some
tests their own dead port) while faking the server higher up, so
`tests/unit/conftest.py` stubs the probe; the new test file restores the
real one.
- The non-streaming chat path is unchanged.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
rapuckett pushed a commit to rapuckett/gaia that referenced this pull request Nov 19, 2026
Eight relay tests are failing on main again. amd#8375 made the agent check
a document's file permission on every turn, and the fake agents in these
tests had no permission checker. Production is unaffected, because the
real agent always has one. CI didn't notice because it skips these tests
(amd#8392 tracks making it run them).

## Test plan
- [x] `pytest tests/unit/test_relay_always_allow.py
tests/unit/test_relay_flagship_tool_history.py
tests/unit/test_relay_followup.py
tests/unit/test_relay_flagship_documents.py` with the flagship
installed: 79 passed (8 failed on main)
rapuckett pushed a commit to rapuckett/gaia that referenced this pull request Nov 19, 2026
# GAIA v0.26.1 Release Notes

## Summary

- Changing the model server, connectors or skills in Settings now takes
effect in chats that are already open, including the terminal UI.
- "Am I free?" no longer says yes when an Outlook meeting's time can't
be read.
- A chat on a cloud model is no longer offered a large local download.
- After an agent crash, the next message gets a fresh answer instead of
the old one continued.
- 11 PRs merged since v0.26.0.

## What's New

- **Settings reach open chats** — a model server, connector or skill
change applies on the chat's next message, in the Agent UI and the
terminal UI. The terminal UI and `gaia -p` now offer only the MCP
servers turned on for GAIA. (PRs
[amd#8389](amd#8389),
[amd#8394](amd#8394),
[amd#8399](amd#8399),
[amd#8400](amd#8400))

## Bug Fixes

- **Outlook availability is no longer guessed** — a meeting whose time
can't be read is reported instead of skipped, and Outlook times parse on
Python 3.10. (PR [amd#8267](amd#8267))
- **No unwanted local download on a cloud model** — Settings › Manage
downloads leaves the local chat model unticked while chat runs on a
cloud model. (PR [amd#8086](amd#8086))
- **A reply cut short by a crash isn't continued** — the next message is
answered fresh. (PR [amd#8391](amd#8391))
- **A command's timeout never outlasts the turn's time limit.** (PR
[amd#8424](amd#8424))
- **An MCP connector shows Connected only after a check has started
it.** (PR [amd#8434](amd#8434))
- **A document overlap of 0 repeats nothing between chunks.** (PR
[amd#8382](amd#8382))
- **Closing the resource strip says how to bring it back.** (PR
[amd#8432](amd#8432))
- **A release candidate names its own pre-release as the agent's
source.** (PR [amd#8433](amd#8433))
- **The "GAIA doesn't run this model server" line is translated in
Arabic.** (PR [amd#8435](amd#8435))
- **Relay tests run against fake agents that match the real one.** (PR
[amd#8393](amd#8393))

## Full Changelog

**11 PRs** since v0.26.0. The PR links above are the changelog.

Full Changelog:
[v0.26.0...v0.26.1](amd/gaia@v0.26.0...v0.26.1)
rapuckett pushed a commit to rapuckett/gaia that referenced this pull request Nov 19, 2026
… down (amd#8436)

With the app pointed at a model server GAIA doesn't run
(`LEMONADE_BASE_URL`, or "use my server") and that server down, a
message waited about a minute and then said the model "may be loading or
briefly busy — try sending the message again". Retrying could never
help. The chat now ends in a few seconds and says what the banner says:
the model server at that address isn't answering, start it, then send
again.

Closes amd#8343

**Evals:** no prompt, tool or classification change; the turn raises the
existing server-down error earlier. `tool_calling` and `rag_quality` are
the categories the issue named to watch on the next RC.

## Test plan

- [x] Live, source backend on an isolated profile with
`LEMONADE_BASE_URL` at a closed port: a local-model chat went from 56 s
and "briefly busy" to 5.9 s and "The local model server at
127.0.0.1:59999 isn't answering…"; a cloud-model chat from 10.7 s and
"briefly busy" to 5.9 s with the same message
- [x] `python -m pytest
tests/unit/chat/ui/test_users_server_down_fails_at_once.py` — 5 new
tests, one through a real streamed turn
- [x] `python -m pytest tests/unit -n 8` — 47,199 pass; the only 10
failures are the relay tests already failing on main (amd#8392, fixed by
amd#8393)
- [ ] Reviewer: in the desktop app with "use my server" set and that
server stopped, a message fails within a few seconds with the new text
(checked on the source backend only)

<details>
<summary>🔍 Technical details</summary>

- `_refuse_turn_on_stopped_users_server` runs first in the streamed
turn's worker, before the warm-up wait and agent construction, so both
the in-process and the relayed paths get it. It only acts when
`configured_lemonade_url()` is set, so GAIA's own server keeps its
restart path.
- The unit suite plants `LEMONADE_BASE_URL=http://127.0.0.1:1` (and some
tests their own dead port) while faking the server higher up, so
`tests/unit/conftest.py` stubs the probe; the new test file restores the
real one.
- The non-streaming chat path is unchanged.
</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

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants