Repository navigation
fix(chat): a stopped reply stays stopped; tools without an answer say so - #5543
Conversation
After Stop, the next message got the stopped answer anyway: the model saw the stopped request with a blank reply, took it as still pending, and answered it before the new question. A stopped turn now reads to the model as withdrawn, and so does a turn cut off when GAIA closed. - History for in-process agents, relayed sidecars and Retry with... comes from model_context_messages, which replaces a "Cancelled." or cut-off reply with a short note saying it was stopped and not to continue it. - A turn stopped mid-answer records what it showed plus that note. - The footer of a stopped or cut-off bubble says "Stopped after 16 s" / "Interrupted after 16 s" instead of "Answered in 16 s".
A turn that ran tools and then wrote no answer ended on an empty bubble with no explanation, and the chat list showed it as done. Empty content is now kept only when a render card answered the turn; otherwise the turn ends failed with "GAIA ran its tools but didn't write an answer. Send your message again, or try another model." and keeps its tool steps.
|
Verdict: Approve with suggestions Two bugs fixed. Stopping a reply and then asking something new no longer brings the stopped answer back. And a turn where the agent ran tools but wrote no answer now ends with a clear "send again or try another model" message instead of an empty bubble marked done. I found nothing that blocks merge. Every path that builds the model's history now goes through the new rewrite, and the Python and UI tests cover the two cases that matter: stop before any text and stop mid-answer. The PR already lists the eval categories to watch on the next RC ( Real-world evidenceN/A here: no evidence bundle was produced for this run. The PR description has its own live evidence: a rendered screenshot of Stop followed by a new question, where only the new question is answered, plus a written account of the 31 s stop and the "Stopped after 31 s" footer. My verdict rests on that screenshot and on reading the code. I didn't run the tests myself (pytest isn't installed on this runner), so the "tests pass" claim comes from the PR's test plan. 🔍 Technical detailsIssues 🟢 The UI keeps its own copy of the cut-off notice strings ( 🟢 A real answer of exactly "Cancelled." gets read as a stop ( Already noted in the PR, not re-flagged: when a reply is stopped mid-answer and relayed to a sidecar, the sidecar still gets the plain partial text, and the non-streaming Strengths
|
The message footer recognises a stopped or cut-off turn by matching the server's notice text. A reworded notice on the server would quietly turn that footer back into "Answered in…", so a test now fails when MessageBubble.tsx stops listing any of them.
|
A test now fails if the UI's copy of the stopped and cut-off reply text drifts from the server's. I left the exact-"Cancelled." case as is, and the red Linux CLI check was a Launchpad outage, not this PR. 🔍 Technical details
|
amd#5543 landed on main as a squash, so its stacked commits conflicted. Kept this branch's health-checked empty-answer copy and sidecar stop note, kept main's parametrized notice drift test, and read the turn's model from result_holder now that main dropped session_model.
…md#5552) When a chat reply came back with no answer and no tool steps, the Agent UI always told the user to make sure Lemonade Server was running, even when Lemonade was up and the model had simply returned nothing (seen live with Qwen3.5 4B and Gemma 4 E4B on a working server). Now GAIA checks Lemonade's health before saying why. If the server is down, the message says so and how to start it on this machine. If the model isn't loaded, it says that. If everything is fine, it says the model returned an empty answer and suggests sending again or switching models. **Stacked on amd#5543.** Merge that first; this PR then shows only its own commit. Error classification changed, so watch the **error_recovery** eval category on the next RC. ## Test plan - [ ] `python -m pytest tests/unit/chat/ui/test_chat_helpers.py tests/unit/chat/ui/test_empty_answer_tail.py`: covers server down, unhealthy (HTTP 503), up without the model, up with the model loaded, `user.` id matching, cloud model, and eval-on-Claude (no probe) - [ ] `python util/lint.py --black --isort --flake8` - [ ] With Lemonade running, get an empty reply (Qwen3.5 4B, short prompt): the bubble says "The model returned an empty answer…" and doesn't mention Lemonade - [ ] Stop Lemonade and send a message: the error names the server URL and gives this machine's start hint, not `lemonade-server serve` <details> <summary>🔍 Technical details</summary> - `_empty_answer_backend_problem` (async) reads `/health` through `LemonadeManager.get_base_url()` with auth headers. It runs only when the turn has no steps and wasn't cancelled. - Server down or unhealthy → `error` SSE, as before. Server fine → `failed` done event with `_EMPTY_MODEL_ANSWER_MSG`, the same path as the tools-but-no-answer case. - The agent's own `model_id` is preferred over the session model for the loaded check. Cloud models skip that check. - Updated the matching troubleshooting copy in `docs/guides/agent-ui.mdx`. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
After Stop, the next message got the stopped answer anyway: the model saw the stopped request with a blank reply, took it as still pending, and answered it before the new question. A turn that ran tools and then wrote nothing ended on an empty bubble marked done. Now a stopped (or cut-off) turn reads to the model as withdrawn, its footer says "Stopped after 31 s" instead of "Answered in…", and a tools-but-no-answer turn ends as failed with a message saying to send again or try another model.
Test plan
pytest tests/unit/chat(incl.test_stopped_turn_history.py,test_empty_answer_tail.py): 2175 passednpx vitest runinsrc/gaia/apps/webui: 1533 passedcontext_retentionand the multi-turngaia_*categories (the history the model sees after a stop changed)🔍 Technical details
model_context_messages()builds the history for in-process agents, the sidecar relay and Retry with…; it replaces a "Cancelled." or cut-off reply with a short note that the turn was stopped and shouldn't be continued. Existing chats are fixed too, since the rewrite happens on read./api/chatpath doesn't use the new empty-answer outcome.