Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

agent chat: agent detection finishes on the start page (#3265)

Adam Hickerson186096cbe6e2
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index ca2ea57207..de84fb95c4 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 0000000000..cf74cb2293
--- /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"}}
+]