Skip to content

test(relay): fix the stale fake agents in the flagship relay tests - #8371

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

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:test/relay-fakes-indexed-files

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Ten relay tests have been failing on main since #8025, and CI never noticed because it never runs them. They cover the flagship relaying tool history, "always allow" grants and follow-ups, so a real regression in any of those would also go unseen.

  • Why they failed: the sidecar now syncs attached documents on every turn and reads indexed_files and rag, which the fake agents lacked. The fakes now start with the same empty document state as a real agent. No assertion changed.
  • Why CI never saw it: these tests need the flagship package installed, and the main unit step doesn't install it, so they always skip. The follow-up is to add the three files to the existing "Run relay document tests" step in test_unit.yml, which already installs the flagship. It isn't in this PR because the token used here can't edit workflow files.
  • Also fixes test_playback_without_sounddevice_names_the_talk_extra, which expected the wheel install hint on an editable checkout.

Test plan

  • With the flagship installed, pytest tests/unit/test_relay_flagship_tool_history.py tests/unit/test_relay_always_allow.py tests/unit/test_relay_followup.py passes 58/58 (10 failed before)
  • pytest tests/unit/test_lemonade_speech.py passes on an editable checkout

Ten relay tests fail on main the moment they run. Since amd#8025 the flagship
sidecar syncs attached documents on every turn (the backend always sends a
list), reading agent.indexed_files and agent.rag, which the fake agents
lacked. The turn died before process_query, so the tool-history tests that
read agent.seen[1] also hit IndexError.

- Give _WritingAgent, _ToolAgent and _FollowUpAgent the empty document
  state a real GaiaAgent starts with.
- test_playback_without_sounddevice_names_the_talk_extra expected the
  wheel install hint, but an editable checkout correctly gets
  `-e <checkout>[talk]`; pin the wheel branch in the test.
@github-actions github-actions Bot added the tests Test changes label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This fixes ten relay tests that have been failing on main without anyone seeing it. It also fixes a speech test that fails on an editable checkout. The fix is right: the fake agents now carry the same empty document state a real agent starts with, and no assertion was loosened.

The one thing to know is that these three relay files still run in no CI lane, so they will keep skipping, and could go stale again, until the follow-up lands. The description says why that isn't in this PR. Please file the follow-up as an issue before merge so it doesn't get lost.

Real-world evidence

N/A: this PR changes tests only. No evidence bundle was produced, and the verdict rests on static review. I couldn't run the tests here because pytest isn't installed on this runner. The PR's test plan reports 58/58 passing with the flagship installed.

🔍 Technical details

Issues

🟡 Follow-up: run the flagship relay tool-history, always-allow and follow-up tests in CI. test_relay_flagship_tool_history.py, test_relay_always_allow.py and test_relay_followup.py are still collected by no lane that installs the flagship. The "Run relay document tests" step in .github/workflows/test_unit.yml (lines ~398, ~729, ~803) runs only test_relay_flagship_documents.py. This is the "a test in no CI lane" class (#5133). Add the three paths to that step in all three jobs, or file the issue before merge.

Checked

  • Patching gaia.agents.install_hints.editable_gaia_root takes effect. kokoro_tts → sounddevice_hint.missing_extra_hint → gaia_extras_install_args looks up editable_gaia_root as a module global at call time, so the patch is seen and the wheel wording amd-gaia[talk] is pinned.
  • indexed_files: set and rag = None match what ChatAgent.__init__ sets up (chat_agent.py:886), and those are the attributes the per-turn document sync reads.
  • Documentation drift: none. The PR changes only tests.

Strengths

  • The fakes now match the real agent's starting state instead of the assertions being relaxed, so the tests still check what they were written to check.
  • The speech-test fix pins an environment-dependent branch explicitly instead of special-casing the editable install.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Filed the CI follow-up the review asked for as #8377. Checked locally: with the flagship importable, these 10 relay tests fail on main and pass on this branch, with nothing else in the four files changing result.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 17, 2026
Merged via the queue into amd:main with commit 472a16e Nov 17, 2026
35 of 36 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the test/relay-fakes-indexed-files branch November 17, 2026 00:31
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