(
state: State<'_, AppState>,
request: UpdateSubagentRequest,
)
| 183 | |
| 184 | #[tauri::command] |
| 185 | pub 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")] |
nothing calls this directly
no test coverage detected