Repository navigation
fix: Agent UI and agent bugs found in an end-to-end UI test - #5311
Conversation
|
Verdict: Approve with suggestions This PR fixes a batch of real bugs from an end-to-end Agent UI run. GAIA no longer asks to approve writes it would refuse anyway. A wrong file path no longer sets off a drive-wide search loop. Recalled memory no longer passes for the user's request. Cloud chats stop dropping history after a couple of turns. Failed sends now show a readable error. Each fix is small, scoped and covered by a focused test, and I found nothing blocking.
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on static review alone. The Agent UI changes (approval refusal, send-while-loading, error text, Privacy folder, mobile-access error state) still need the 🔍 Technical detailsIssues 🟢 Backslashes vanish from the test path ( 🟢 Dropped initial load leaves the message count unsynced ( Checked and fine
Strengths
|
|
Both suggestions are handled. The data-folder test now uses a real Windows path. On the initial-load question: on the error path no refetch runs, but the next visible poll sees the changed count and syncs the list from the server. That's correct; the comment now says so instead of claiming a refetch. One more change came out of testing the open UI PRs together: The latest Linux unit-test failure is a timing flake in 🔍 Technical details
|
The Agent UI asked "Allow writing file?" for a path in the system temp folder; the user clicked Allow, and the write was then refused as off-limits. The write tools' preflight now refuses such paths up front, still audited as denied.
Given a wrong absolute path, the agent ran a dozen whole-drive searches over nearly three minutes before saying the file wasn't there; read_file's error even told it to search elsewhere. read_file and index_document now share one error: name what is missing, allow one search, then ask the user.
A file a past chat's error left in memory (eval/corpus/adversarial/empty.txt) was sent back as "you haven't read empty.txt, read it now" in an unrelated chat: memory is prepended to the message, and the grounding check treated every path in it as part of the request. Both grounding entry points now use the clean request, as the plan executor already does.
…swer Asked for "the same report as bullets", the agent let the request override the 3-bullet cap and wrote five. The limits now hold for a reformat too; only a number the user names overrides them.
Dropping a .mdx doc was rejected as unsupported, though it is Markdown; .markdown and .rst had an extractor but no way in.
It was the one dialog that ignored Escape.
…start With ngrok missing it showed a red 'Failed to connect' QR placeholder and 'Scan the QR code' steps under the real reason.
Screen readers heard two unnamed buttons under Memory > Advanced.
…budget On Fireworks, older messages dropped out of view after two short turns: the 64K cloud input budget also reserved 32K for the reply, leaving ~12K for history although the reply is written into the provider's own, far larger window. Cloud models now reserve nothing there; local models are unchanged.
A server error during send showed 'HTTP 500: {"detail": ...}' under an all-caps mono label; it now shows the server's reason in the sentence-case banner. A send whose stream closed before any answer left the message with no answer and no error; it now reports that the connection closed.
A minimized Agent UI kept asking for system status every 5 s and the open chat's message count every 3 s. Both now pause while hidden and refresh once shown; the chat-list and active-run polls keep running because they raise notifications while the user is in another app.
…l in words Sending right after opening a chat could lose the message: the history load that started first landed later and replaced the list. A load that began before a send now leaves the list to the turn's own refetch. The live line said "Running search_web" while the step row said "Searching web"; it now uses the step's wording.
It always said ~/.gaia/chat/, wrong for anyone with GAIA_HOME set. System status now reports the chat database's folder, and the row shows only once it is known.
'D:\gaia-home' in a JS string drops its backslashes, so the test compared two backslash-free strings. Also corrects a comment: after a failed send, the next poll (not a refetch) syncs the message list.
api.ts is 41 KB on main, and the open Agent UI PRs together take it to 51 KB, past the 50 KB per-file limit the Electron installer test enforces. Main would fail that test once they all land. The connector section, which no open PR touches, moves to connectorsApi.ts, and api.ts re-exports it, so no caller changes.
…rches for it The per-turn [Indexed documents: ...] line gave filenames only. For an attached CSV the agent searched the disk, found many copies and opened the wrong one, then hit an access denial. Each entry now carries its path. csv_analysis went from 5.4 to 10/10; rag_quality has no regressions.
After query_specific_file ran, the answer check still said no search ran this turn, so the agent re-ran its searches and sometimes left the check's note in the answer. Tools named query_* now back a search claim, and "I ran two searches" reads as a search, not a command.
…oking get_file_info, the edit tools and the filesystem read returned a bare 'File not found', so the agent searched folder after folder and asked for access to whole directories. They now use the shared error with its one-search stop rule.
When an access prompt went unanswered, every tool that touched the same folder asked again and waited out the 10-minute timeout again. skill_document_brief_gaps spent 30 minutes on one turn that way. A path declined or left unanswered is now refused without asking for the rest of the turn, along with anything inside it; the next turn asks afresh.
e58dde6 to
dc6cb16
Compare
# Conflicts: # src/gaia/apps/webui/src/App.tsx # src/gaia/apps/webui/src/components/ChatView.tsx # src/gaia/apps/webui/src/services/api.ts
# Conflicts: # src/gaia/apps/webui/src/components/AgentActivity.tsx # src/gaia/apps/webui/src/components/settings/PrivacySettings.tsx
# Conflicts: # src/gaia/apps/webui/src/App.tsx
# Conflicts: # src/gaia/ui/database.py
# Conflicts: # src/gaia/security.py
# Conflicts: # src/gaia/apps/webui/src/components/ChatView.tsx
|
Verdict: Approve with suggestions This PR fixes about fifteen bugs found in an end-to-end run of the Agent UI. The worst of them: an approval card that couldn't actually grant the write, the agent searching the whole drive a dozen times for a file that was never there, a file from an old chat's memory showing up in an unrelated chat, cloud chats losing their history after two turns, and send failures that showed nothing or a raw JSON body. Each fix is small and has a test, and the backend and frontend changes agree with each other. I found no correctness bugs that block a merge.
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on reading the code and the PR's unit and vitest tests. None of the Agent UI flows above were exercised here. 🔍 Technical detailsIssues 🟡 No real-world evidence for UI-visible changes. The PR changes the Agent UI (send errors, the live tool label, Mobile access, Privacy's data folder, Escape on Scheduled tasks) and the 🟢 A failed initial load can still wipe a just-sent message ( 🟢 🟢 Circular import between Strengths
|
…md#5326) Before, a chat didn't show where it ran, what it could touch, or what it changed on disk, and its folder and internet settings weren't enforced. Now each chat has a session panel with this answer's sources, where the chat runs, the folders it may use, an internet switch, everything it produced, and every file it changed, plus a whole-chat diff, Undo all, and a git Commit or PR that runs only after you confirm. Removed folders and internet-off are enforced by the agent itself, before any approval prompt. Only true loopback addresses count as "this PC", and a commit never stages files git ignores. It also carries fixes found testing the merged UI: Retry with… lists friendly model names, names update once they load, local models get their own still-waiting hint, New chat focuses the message box and its task cards come back on their own, the panel's resize edge is easier to grab, and a web call that internet-off refused no longer shows as a failed lookup or as a site GAIA contacted. This PR now replaces amd#5283 (closed). It was rebuilt on main so it carries only what isn't merged yet. ## Test plan - [x] `npx tsc --noEmit`, `npx vitest run` (1465 passed) and `npm run build` in `src/gaia/apps/webui` - [x] `npx jest` in `tests/electron`: all pass on Linux line endings; ChatView is 101.6 KB of the 102.4 KB limit - [x] `pytest tests/unit/agents tests/unit/chat/ui` plus the security and shell suites; the only failures also fail on main on this machine (a background thread trying to start the daemon, and `test_step_timing`) - [x] `python util/lint.py --black --isort` - [x] Agent UI on a fresh GAIA home with a local model: a turn edits two files in a git folder, the panel shows them under Outputs and Changes, Review changes shows the diff, Commit commits only those files, and Undo all restores them (screenshots in the evidence comment) - [x] Agent UI with internet off: web search and a page fetch are refused before running, the message box says the chat is offline, and the panel doesn't claim a failed lookup or a contacted site - [ ] Flagship eval at the next RC: the agent loop now refuses calls up front when internet is off or a folder was removed <details> <summary>🔍 Technical details</summary> - Rebuilt from `origin/main` by cherry-picking the amd#5283 commits and this PR's own fixes. Commits already on main via amd#5275 or amd#5311 were dropped (the Retry with… turn-queue fix, the live-line tool label, `visibleInterval`). API types were regenerated with `export_openapi` + `gen:api-types` and match the merged files. - Conflicts were resolved keeping main's behaviour. `PathValidator.validate_read` keeps main's missing-file-instead-of-prompt flow and checks removed folders first. Main's deepest-first removal of created folders moved into the new shared `_apply` used by Undo and Undo all. `ContextPanel` was split into `ContextDetails` (shown in the panel) and the standalone sheet, starting from amd#5275's final per-section error handling. - New: `useJumpToMessage` moves jump-to-turn out of ChatView to keep it under the size budget. `turn_summary._ran` skips calls whose result says they never ran (`executed: False` or `status: denied`) when it counts sites and live-data failures. The guide no longer says localhost pages stay fetchable offline, because the web tools refuse private addresses on their own. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
An overnight end-to-end test of the Agent UI, run against a live backend with every open UI PR merged, turned up these bugs in code already on main. Each one wasted the user's time or misled them.
After this PR, each of these works as the user would expect.
.mdx,.markdownand.rstcan be added to the document library.Several of these change what the model sees: the tool error wording, the grounding input, the history budget and the summarize skill. Categories to watch on the next RC:
error_recovery,rag_quality,context_retention,tool_selection. A local run on Fireworks scoredtool_selection7/7 andcontext_retention4/4. With the document and access-prompt fixes, all 12rag_qualityscenarios passed (csv_analysiswent from 5.4 to 10/10), where this morning's run passed 9 of 12.Test plan
python -m pytest tests/unit/agents tests/unit/chatpassesnpx vitest runandnpx tsc --noEmit -p .insrc/gaia/apps/webuipasspython util/lint.py --black --isortpassesgaia chat --ui: ask GAIA to write a file under%TEMP%; it refuses without showing an approval cardgaia chat --ui: open a chat and send immediately; the message stays after the history loadsgaia chat --uion a Fireworks model: after four or five turns, the earliest messages are still in view🔍 Technical details
read_first_preflightrefuses whenPathValidator.unaskable_reason()is non-empty (temp dir, blocked or secret dirs, env scope), and the refusal is still audited as denied. Askable out-of-scope paths are unchanged.missing_file_error()inpath_access.pyis shared byread_fileandindex_document; the old error told the model to search elsewhere._grounding_findingsand_note_ungroundeduse_original_user_input, as the plan executor already does.history_budgetsubtracts no reply reserve for Lemonade cloud models. Local models and Claude are unchanged, and the doc inagent-ui.mdxis updated. feat(agent): move already-read tool results out of the prompt before the window fills (opt-in) #5310 also editshistory.py, so whichever lands second has a small conflict.consumeSSEResponsetakessilentCloseIsErrorfromsendMessageStreamonly, so re-attach still treats an empty replay as done.setVisibleIntervalpauses the system-status and message-count polls only. The chat list and active-run polls keep running, because they drive notifications while the user is in another app.data_dir;api.gen.tsandapi.schemas.jsonare regenerated.