Repository navigation
fix(chat): only teach image generation when the session has it - #4574
Conversation
|
🔍 Technical detailsLocal Gemma-4-E4B on Radeon 8060S, sandboxed fresh install with its own embedded Lemonade; two Agent UI servers (integration build on :4301,
The integration build was faster on 7 of 8 scenarios. It ran before the last wording tweak to the indexed-documents rule ("the latest message's line"), which is not reflected here. |
4ec9893 to
53cc450
Compare
A new user's "What can you do?" in the Agent UI was answered with "...or generating concept art" although image generation is off by default: the prompt carried the generate_image rule in every session. The rule now appears only with enable_sd_tools; otherwise the prompt says image generation is not available.
53cc450 to
934f8a5
Compare
The image-generation rule now depends on enable_sd_tools. The flag is set once per session, so either rule must leave the system prompt byte-stable across turns. The cached-prefix test runs the flagship with the flag on; this runs two turns with it off.
|
Verdict: Approve with suggestions. Hold the merge until the eval runs, since this changes the system prompt. The fix is right: a session without image generation no longer carries a rule about Before merge:
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on static review alone. The user-visible change (how the Agent UI answers a capability question) and the eval impact both still need the strix-halo lane. 🔍 Technical details🟡 Important
🟢 Minor
Strengths
|
It imports gaia_agent_chat, which test_unit.yml's Linux lane doesn't install, so it skipped wholesale there (#4574) and check_module_skips.py has been failing every PR since. test_chat_agent.yml already installs that wheel; add it to the pytest invocation, path triggers, and the module_skips allowlist.
…ation (amd#4809) Asking GAIA "What can you do?" threw away its answer and tried to generate an image of the question. Any answer that mentioned image generation was treated as a failure to call the image tool, with no check that the user wanted an image or that the agent could make one — and the flagship has image generation on by default, so this hit the most common first question. Now a plain answer is never overridden; the agent only steps in when an image was actually attempted this turn and the answer doesn't say what happened. Closes amd#4582. Supersedes the approach in amd#4583, which decides from the wording of the user's message and so misses requests like "Draw a cat"; this one decides from the turn's tool record instead. <details> <summary>🔍 Technical details</summary> - Removed: the branch that matched the answer against capability phrases and, with no `generate_image` call on record, demanded one built from the user's last message. The tool record cannot show intent, so there is nothing structural to gate it on; whether to call the tool is the prompt's and tool schema's job (amd#4574). - Kept, gated on a `generate_image` call that returned a result this turn on an agent with the tool registered: an answer that says when image generation is available instead of reporting the outcome gets one correction, which now names the recorded outcome (succeeded / returned an error). It was unbounded before. The amd#1023 failure override is unchanged. - A wording check on the answer remains in that kept path because the record holds the outcome but not what the answer claims about it. It can no longer run without a recorded outcome. - A call to a `generate_image` the agent doesn't have no longer arms either check. </details> ## Test plan - [x] `python -m pytest tests/unit/agents/test_image_outcome_guard.py tests/unit/agents/test_parse_error_recovery.py` — the new reproduction fails on main and passes here; the amd#1023 cases still pass - [x] `python -m pytest tests/unit/agents hub/agents/gaia/python/tests/test_prompt_prefix_stability.py` - [ ] `eval_flagship.yml` — `gaia_media` - [ ] `eval_flagship.yml` — `gaia_core` - [ ] `eval_flagship.yml` — `personality` - [ ] `eval_flagship.yml` — `tool_selection`
A new user's first Agent UI question, "What can you do?", was answered with "…researching topics online or generating concept art when inspiration strikes" — but image generation is off by default. Every session's prompt carried the
generate_imagerule ("when SD enabled"), and a small local model read that as a capability. The rule now appears only when image generation is enabled; otherwise the prompt says it isn't available.Draft until an eval runs — this changes the system prompt.
Test plan
pytest tests/unit/test_sd_rule_gating.py— the rule followsenable_sd_toolspytest hub/agents/gaia/python/tests/test_prompt_prefix_stability.py hub/agents/gaia/python/tests/test_prompt_prefix_stability_sd_off.py: with image generation on or off, the system prompt is byte-identical across turnsgaia eval agent --category rag_qualityand--category gaia_core(and a capability-question scenario) on this branch and on main