MCPcopy Create free account
hub / github.com/GCWing/BitFun / show_available_subagent_list

Method show_available_subagent_list

src/apps/cli/src/modes/chat.rs:3115–3152  ·  view source on GitHub ↗
(
        &self,
        chat_view: &mut ChatView,
        chat_state: &mut ChatState,
        rt_handle: &tokio::runtime::Handle,
    )

Source from the content-addressed store, hash-verified

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,

Callers 1

Calls 8

get_agent_registryFunction · 0.85
add_system_messageMethod · 0.80
collectMethod · 0.80
show_subagent_listMethod · 0.80
workspace_path_bufMethod · 0.45
cloneMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected