From 186096cbe6e28ab5134c49c1f2ca9a503e55a234 Mon Sep 17 00:00:00 2001 From: Adam Hickerson Date: Thu, 22 Oct 2026 20:52:13 +0000 Subject: [PATCH] agent chat: agent detection finishes on the start page (#3265) --- crates/ui-egui/src/lib.rs | 3 +++ .../ui-egui/tests/scenarios/agent_chat_home_page.json | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 crates/ui-egui/tests/scenarios/agent_chat_home_page.json diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index ca2ea5720..de84fb95c 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1599,6 +1599,9 @@ impl SolveApp { if self.home.open { home::show(self, ui); if self.home.open { + // Agent detection runs in the background and is only received by `agent_chat::poll` + // Polling here is required for the detection to complete on Home + agent_chat::poll(self, ui.ctx()); // Preferences and Keyboard Shortcuts open from Home too (its links, the gear, Ctrl+,). prefs::show(self, ui.ctx()); return; diff --git a/crates/ui-egui/tests/scenarios/agent_chat_home_page.json b/crates/ui-egui/tests/scenarios/agent_chat_home_page.json new file mode 100644 index 000000000..cf74cb229 --- /dev/null +++ b/crates/ui-egui/tests/scenarios/agent_chat_home_page.json @@ -0,0 +1,11 @@ +[ + {"note": "With the start page open (as at launch), the agent chat's frame work still runs: agent detection resolves (its \"Looking for agents…\" label goes away) and the Add-agent dialog opens from Settings' AI page."}, + {"call": "ui.home", "params": {"open": true}}, + {"expect": {"home": true}}, + {"call": "ui.prefs", "params": {"open": "AI"}}, + {"expect": {"home": true, "prefs": {"dialog": "AI"}}}, + {"until": {"not_shown": "Looking for agents…"}}, + {"expect": {"shown": "Add agent…"}}, + {"click": {"handle": "prefs:ai_add"}}, + {"until": {"shown_handles": ["ai_add:add"], "shown": "Add agent"}} +]