(&self, id: &str, tasks: &[SubagentTaskSnapshot])
| 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); |
no test coverage detected