(&mut self)
| 1897 | } |
| 1898 | |
| 1899 | fn show_available_subagent_list(&mut self) { |
| 1900 | let registry = get_agent_registry(); |
| 1901 | let subagents = tokio::task::block_in_place(|| { |
| 1902 | let workspace = self.workspace_path_buf(); |
| 1903 | let agent_type = self.agent_type.clone(); |
| 1904 | tokio::runtime::Handle::current().block_on(registry.get_subagents_for_query( |
| 1905 | &SubagentQueryContext { |
| 1906 | parent_agent_type: Some(&agent_type), |
| 1907 | workspace_root: Some(workspace.as_path()), |
| 1908 | list_scope: SubagentListScope::TaskVisible, |
| 1909 | include_disabled: false, |
| 1910 | }, |
| 1911 | )) |
| 1912 | }); |
| 1913 | |
| 1914 | if subagents.is_empty() { |
| 1915 | self.status = Some(format!( |
| 1916 | "No enabled subagents found for agent mode '{}'.", |
| 1917 | self.agent_type |
| 1918 | )); |
| 1919 | return; |
| 1920 | } |
| 1921 | |
| 1922 | let subagent_items: Vec<SubagentItem> = subagents |
| 1923 | .into_iter() |
| 1924 | .map(Self::subagent_item_from_info) |
| 1925 | .collect(); |
| 1926 | |
| 1927 | if subagent_items.is_empty() { |
| 1928 | self.status = Some("No subagents found.".to_string()); |
| 1929 | return; |
| 1930 | } |
| 1931 | |
| 1932 | self.subagent_selector.show_list(subagent_items); |
| 1933 | } |
| 1934 | |
| 1935 | fn show_subagent_config_selector(&mut self) { |
| 1936 | let registry = get_agent_registry(); |
no test coverage detected