(
&self,
chat_view: &mut ChatView,
chat_state: &mut ChatState,
rt_handle: &tokio::runtime::Handle,
)
| 3113 | } |
| 3114 | |
| 3115 | fn show_available_subagent_list( |
| 3116 | &self, |
| 3117 | chat_view: &mut ChatView, |
| 3118 | chat_state: &mut ChatState, |
| 3119 | rt_handle: &tokio::runtime::Handle, |
| 3120 | ) { |
| 3121 | let registry = get_agent_registry(); |
| 3122 | let subagents = tokio::task::block_in_place(|| { |
| 3123 | let workspace = self.agent.workspace_path_buf(); |
| 3124 | let agent_type = self.agent_type.clone(); |
| 3125 | rt_handle.block_on(registry.get_subagents_for_query(&SubagentQueryContext { |
| 3126 | parent_agent_type: Some(&agent_type), |
| 3127 | workspace_root: Some(workspace.as_path()), |
| 3128 | list_scope: SubagentListScope::TaskVisible, |
| 3129 | include_disabled: false, |
| 3130 | })) |
| 3131 | }); |
| 3132 | |
| 3133 | if subagents.is_empty() { |
| 3134 | chat_state.add_system_message(format!( |
| 3135 | "No enabled subagents found for agent mode '{}'.", |
| 3136 | self.agent_type |
| 3137 | )); |
| 3138 | return; |
| 3139 | } |
| 3140 | |
| 3141 | let subagent_items: Vec<SubagentItem> = subagents |
| 3142 | .into_iter() |
| 3143 | .map(Self::subagent_item_from_info) |
| 3144 | .collect(); |
| 3145 | |
| 3146 | if subagent_items.is_empty() { |
| 3147 | chat_state.add_system_message("No subagents found.".to_string()); |
| 3148 | return; |
| 3149 | } |
| 3150 | |
| 3151 | chat_view.show_subagent_list(subagent_items); |
| 3152 | } |
| 3153 | |
| 3154 | fn show_subagent_config_selector( |
| 3155 | &self, |
no test coverage detected