MCPcopy Create free account
hub / github.com/AI45Lab/Code / save_subagent_tasks

Method save_subagent_tasks

core/src/store/file_store.rs:387–404  ·  view source on GitHub ↗
(&self, id: &str, tasks: &[SubagentTaskSnapshot])

Source from the content-addressed store, hash-verified

385 }
386
387 async fn save_subagent_tasks(&self, id: &str, tasks: &[SubagentTaskSnapshot]) -> Result<()> {
388 let path = self.subagent_tasks_path(id);
389 if let Some(parent) = path.parent() {
390 fs::create_dir_all(parent).await.with_context(|| {
391 format!(
392 "Failed to create subagent task directory: {}",
393 parent.display()
394 )
395 })?;
396 }
397
398 let json = serde_json::to_string_pretty(tasks)
399 .with_context(|| format!("Failed to serialize subagent tasks for session {id}"))?;
400 fs::write(&path, json)
401 .await
402 .with_context(|| format!("Failed to write subagent tasks to {}", path.display()))?;
403 Ok(())
404 }
405
406 async fn load_subagent_tasks(&self, id: &str) -> Result<Option<Vec<SubagentTaskSnapshot>>> {
407 let path = self.subagent_tasks_path(id);

Callers 1

saveMethod · 0.45

Calls 3

writeFunction · 0.85
subagent_tasks_pathMethod · 0.80
with_contextMethod · 0.80

Tested by

no test coverage detected