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

Function update_subagent

src/apps/desktop/src/api/subagent_api.rs:185–209  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    request: UpdateSubagentRequest,
)

Source from the content-addressed store, hash-verified

183
184#[tauri::command]
185pub async fn update_subagent(
186 state: State<'_, AppState>,
187 request: UpdateSubagentRequest,
188) -> Result<(), String> {
189 if request.description.trim().is_empty() {
190 return Err("Description cannot be empty".to_string());
191 }
192 if request.prompt.trim().is_empty() {
193 return Err("Prompt cannot be empty".to_string());
194 }
195 let workspace = workspace_root_from_request(request.workspace_path.as_deref());
196 state
197 .agent_registry
198 .update_custom_subagent_definition(
199 &request.subagent_id,
200 workspace.as_deref(),
201 request.description.trim().to_string(),
202 request.prompt.trim().to_string(),
203 request.tools,
204 request.readonly,
205 request.review,
206 )
207 .await
208 .map_err(|e| e.to_string())
209}
210
211#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
212#[serde(rename_all = "lowercase")]

Callers

nothing calls this directly

Calls 4

trimMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected