Repository navigation
feat(ui): Add to this reply and Always allow work with the flagship agent - #5541
Conversation
…turn
"Add to this reply" did nothing for the flagship agent: its turns run in the
daemon sidecar, the backend only knew how to hand a mid-turn message to an
in-process agent, and the 409 that followed was swallowed by the chat, which
quietly put the message back in the queue.
- A relayed turn now forwards the message to the sidecar's
/query/{run_id}/followup (contract 2.15+). The sidecar cannot say when its
agent reads it, so a message it accepts is saved and reported taken at once,
and the turn's follow-up outcome lists only what it accepted.
- A relayed turn that cannot take one (email, an older agent) says so as it
starts, and the chat hides the button for that reply.
- When the reply refuses a message, the queued row now says it can't be added
and will send when the reply ends, instead of reverting without a word.
…rompts
Permission prompts for the flagship never offered "Always allow": its turns run
in the daemon sidecar, which holds any "always" grant in its own session, and
the chat had no way to list or revoke one there, so the relay dropped the
option. The user had to approve the same call every time.
- The sidecar (contract 2.19) lists and revokes a session's "always" answers
at GET/DELETE /v1/gaia/sessions/{id}/grants, including answers given in a
turn still running, and needs_confirmation now carries always_label.
- The chat offers "always" on a relayed prompt only for such a sidecar and
never for calls that need fresh consent, relays the decision, and lists the
sidecar's grants with its own so the session panel and Settings can revoke
them. A revoke the sidecar did not take is a 502 and stays listed.
- Before each relayed turn the chat revokes any sidecar grant it does not list
(one from before the Agent UI restarted), so nothing approves unseen.
|
Verdict: Approve with suggestions The flagship agent now does both things the Agent UI already offered other agents. Add to this reply hands a typed message to the reply that's running. Permission prompts offer Always allow, and those grants are listed and can be revoked next to the chat's own. The design fails safely: a revoke the agent can't confirm stays listed and returns an error, and before each reply the chat revokes any agent-side grant it isn't showing. I found no blocking issues. Before merging:
Real-world evidenceN/A here: no evidence bundle was produced for this run. The PR description includes a live Agent UI screenshot of Add to this reply working: the running answer picked up "end with the word CORMORANT". The author marks the live Always allow run as blocked until a sidecar at contract 2.19 ships. Tests drive it against the real sidecar app ( 🔍 Technical detailsIssues 🟢
🟢 Contract 2.19 collision with #5512. Whichever lands second must bump all of these together: Checked and fine
Strengths
|
… pylint A re-attaching chat rebuilds the turn from its replay buffer, which carries followup_unavailable, but a run past the 8 MB replay cap trimmed it away and offered "Add to this reply" again. Turn-wide state frames are now kept out of the trimmable buffer and replayed first. The console's lazy grant-scope dict is created through the same helper as its lazy sets, so pylint no longer flags an attribute defined outside __init__.
|
Fixed the lint failure and closed the remaining gap where a long-running reply could offer Add to this reply again after a chat switch. The other two red checks were infrastructure flakes, not this change.
🔍 Technical details
|
|
Merge note: #5538, #5541 and #5609 all change the relay loop and the relayed question/prompt state in 🔍 Technical detailsResolution tested live and in unit tests (125 relay/title/queue tests pass combined):
|
…Undo (#5553) In the desktop app, a file the flagship agent wrote never reached the chat's session panel. Outputs stayed on "Nothing yet", and Changes and Undo had nothing to show. Desktop chats run in the daemon's agent sidecar and the Agent UI relays them. The relay skipped the bookkeeping that Outputs is built from, and the sidecar never kept copies of the files it changed. Now a relayed turn's written and deleted files show under the answer that changed them, in Outputs and Changes, and that answer's Undo puts them back. - **Outputs**: relayed turns now record their tool calls the way in-process turns do. This works with sidecar binaries that are already installed, for files written to an absolute path. - **Changes and Undo**: the Agent UI passes a turn id on `/query` (contract **2.19**, `changes_turn_id`). The sidecar copies each file before changing it, into the same undo store the Agent UI reads, and finishes before it reports the turn done. An older sidecar is never sent the field. Its turns still show in Outputs, just without Changes or Undo. - Files the agent deletes with a shell command (for example `del notes.txt`) still show as "untracked shell work" rather than as a deleted file. In-process chats behave the same way, because the shell tool doesn't copy files before running a command. - If #5512 (contract 2.19, `/greeting`) merges first, this PR moves to 2.20 when it's rebased. - If #5541 (contract 2.19, grants) merges first, this PR moves to the next contract number when it's rebased. ## Test plan - [x] `pytest tests/unit/chat/ui/test_turn_changes_recording.py`: the real streaming chat path relays to a stand-in sidecar that records on its own thread, creating one file and deleting another. Both appear in Changes and Outputs under the saved answer, and Undo restores them. A 2.18 sidecar is not sent the field. - [x] `pytest hub/agents/gaia/python/tests/test_server_changes.py`: the recording is finished before `final`, while the agent is still working after its answer. It is also finished when a confirmation is refused. A save that fails is reported before the turn ends. Bad ids, and ids sent without a session, get a 422. - [x] `pytest tests/unit/test_sidecar_relay_fidelity.py tests/unit/agents/test_file_snapshots.py`: a write goes through the sidecar handler, the translator and the relay into the turn summary. Linking the answer can't overwrite the sidecar's own save. Finishing twice keeps an undo made in between. - [x] Agent UI, relay, snapshot and flagship-server suites: the same 3 failures on `main` and on this branch (two tool-bundle tests and one tool-count test, about 7,500 tests in all). No new failures. - [x] `python util/lint.py --black --isort`, and `python -m gaia_agent.export_openapi --check` - [x] Live check with an isolated profile and the flagship relayed to a dev-mode sidecar built from this branch (Gemma 4 E4B, Full access). I asked "Create a file notes.txt in my documents folder with the word hello". The answer shows "Changed 1 file · Review changes · Undo this turn". Outputs lists notes.txt as "File created", and Changes shows "1 file changed, +1 −0". Undo this turn removed the file, and Outputs then marked it Undone. <details> <summary>🔍 Screenshots</summary> After the relayed write:  After Undo:  </details>
Main moved the sidecar contract to 2.25 while this branch waited, so the grants endpoints now land as contract 2.26: server API_VERSION, npm lifecycle, the relay's grants floor, SPEC/SKILL/CHANGELOG, the SSE contract doc, openapi and the capability matrix move together. Relay, SSE handler and chat-helper conflicts keep both sides: main's question tracking, internet switch, turns and context reporting, and this branch's "always" offer and mid-turn follow-up inbox. A queued message's "can't add to this reply" note now shows only while that reply runs, so it no longer hides main's busy-retry wording once the reply has ended.
|
Merged main back in. Main had reached sidecar contract 2.25, so the grants endpoints now ship as 2.26, and every place that names the version moved together. 🔍 Technical details
|
|
Not merging yet: the flagship's own guide on the docs site still says the agent is at contract 2.25, and it doesn't list the two new grants endpoints. Everything else checks out, and the fix is two lines in one file.
🔍 Technical details
Checked and fine at db43404:
|
The GAIA guide still said 2.25 and its endpoint table left out the two grants routes the rest of the docs already describe.
|
Not merging yet: the branch conflicts with main again. Main shipped the flagship agent as 0.3.3, which moved the Unreleased changelog entries under the 0.3.3 heading, so the new "contract 2.26" entry no longer merges. Everything else checks out — the guide fix is right, no doc still calls the current contract 2.25, and 2.26 is still free on main. Next step: merge main back in and keep the 2.26 entry under 🔍 Technical details
|
## Why this matters v0.25.4 is cut for Arabic support: the Agent UI runs right to left in Arabic, and people can ask about Arabic, English or mixed documents in either language (amd#6165). It also adds a local-only mode that keeps every AI request on the PC, image indexing, and email thread reading for the GAIA agent. Among the fixes, chats no longer get stuck on "Waiting for the GPU", and file paths resolve to the chat's folder and the real Documents folder. 59 commits since v0.25.3; the notes are in `docs/releases/v0.25.4.mdx` and credit 7 outside contributors. This is a patch carrying 8 `feat` commits, approved as v0.25.4 for the Arabic RC. ## Test plan - [x] `python util/validate_release_notes.py docs/releases/v0.25.4.mdx --tag v0.25.4` passes, and with `--tag v0.25.4-rc1` - [x] `mintlify validate` (from `docs/`) passes - [x] `python util/release_versions.py --check`, `python util/check_doc_links.py --internal-only` and `python util/check_doc_versions.py` pass - [x] `python util/check_component_core_api.py --release-version 0.25.4` passes - [x] `pytest tests/unit/test_docs_json_release.py tests/unit/test_check_component_core_api.py tests/unit/test_release_tag.py tests/unit/test_hub_core_version_gate.py tests/unit/test_release_versions.py hub/agents/gaia/python/tests/test_npm_doc_min_version.py`: 230 passed - [x] Re-run the above after amd#6165 merged and main was merged in - [ ] CI green on the merge commit - [ ] `release_train_dryrun.yml` passes on that commit before the RC tag ## Evals to re-run on the RC tag LLM-affecting PRs merged without per-PR evals; run these on `v0.25.4-rc1`: - `rag_quality` and `real_world` (amd#6165, amd#6057) - `gaia_rag` and `gaia_media` (amd#5651) - `gaia_email` (amd#6124) - `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5450, amd#5454, amd#6080) - `gaia_files` and `gaia_shell` (amd#6069, amd#6074, amd#6120) - `gaia_code` (amd#6056) - `gaia_core` and `context_retention` (amd#6152) - `gaia_data` and `tool_selection` (amd#6053, amd#6130) - `memory` and `gaia_memory` (amd#6127, amd#6081) - `gaia_tool_selection` for tool confirmations (amd#5541) ## Release checklist - [ ] Keep amd#6114 unmerged until v0.25.4 is tagged, so main stays on 0.25.4 - [ ] Freeze main, wait for green CI on the exact commit, pass `release_train_dryrun.yml`, then push `v0.25.4-rc1` (the RC freezes its own flagship; no agent release needed) - [ ] Before the final: release the flagship from the release commit (`agent-pkg-gaia-v<next>`), merge its pin-lock PR, and pass `check_flagship_release.py` - [ ] Extend the changelog if main gains commits before the tag
For the flagship agent, Add to this reply did nothing (the message quietly went back into the queue) and permission prompts never offered Always allow, so users had to approve the same call every time. Both now work: a mid-reply message is handed to the running turn, and "Always allow" is offered, listed with the chat's other grants, and revocable from the session panel and Settings.
Contract note: main reached sidecar contract 2.25 while this waited, so the grants endpoints ship as 2.26.
Test plan
pytest tests/unit/chat tests/unit/test_relay_followup.py tests/unit/test_relay_always_allow.py tests/unit/test_relay_tool_confirmation.py tests/unit/test_sidecar_relay_fidelity.py tests/unit/test_stdio_permission_control.py: 2316 passednpx vitest runinsrc/gaia/apps/webui: 1526 passedgaia_*categories that use tool confirmations🔍 Technical details
/query/{run_id}/followup(contract 2.15+). The sidecar can't report when its agent reads it, so an accepted message is saved and reported taken at once.GET/DELETE /v1/gaia/sessions/{id}/grantsandalways_labelonneeds_confirmation. A revoke the sidecar refuses is a 502 and stays listed.API_VERSION, npmlifecycle.ts, profile minimums, SPEC/SKILL/CHANGELOG, openapi and capability matrix).