Show agent selector popup with all available agent modes
(
&self,
chat_view: &mut ChatView,
chat_state: &mut ChatState,
rt_handle: &tokio::runtime::Handle,
)
| 2199 | |
| 2200 | /// Show agent selector popup with all available agent modes |
| 2201 | fn show_agent_selector( |
| 2202 | &self, |
| 2203 | chat_view: &mut ChatView, |
| 2204 | chat_state: &mut ChatState, |
| 2205 | rt_handle: &tokio::runtime::Handle, |
| 2206 | ) { |
| 2207 | let modes = self.get_mode_agents(rt_handle); |
| 2208 | if modes.is_empty() { |
| 2209 | chat_state.add_system_message("No mode agents available".to_string()); |
| 2210 | return; |
| 2211 | } |
| 2212 | |
| 2213 | let agent_items: Vec<AgentItem> = modes |
| 2214 | .into_iter() |
| 2215 | .map(|m| AgentItem { |
| 2216 | id: m.id, |
| 2217 | description: m.description, |
| 2218 | }) |
| 2219 | .collect(); |
| 2220 | |
| 2221 | chat_view.show_agent_selector(agent_items, Some(self.agent_type.clone())); |
| 2222 | } |
| 2223 | |
| 2224 | /// Apply agent selection: switch agent type |
| 2225 | fn apply_agent_selection(&mut self, selected: &AgentItem, chat_state: &mut ChatState) { |
no test coverage detected