Replace the tracker's task snapshots with the given set. Cancellers are **not** restored (they are runtime-only channels tied to live child loops). After `replace_snapshots`, any task whose status was `Running` at checkpoint time will appear `Running` in the tracker but `cancel(task_id)` will return `false` because no canceller is registered — callers should normally checkpoint at a quiescent poin
(&self, snapshots: Vec<SubagentTaskSnapshot>)
| 320 | /// restore the materialized subagent view of a previously-saved |
| 321 | /// session. |
| 322 | pub async fn replace_snapshots(&self, snapshots: Vec<SubagentTaskSnapshot>) { |
| 323 | let mut map = HashMap::with_capacity(snapshots.len()); |
| 324 | for snap in snapshots { |
| 325 | map.insert(snap.task_id.clone(), snap); |
| 326 | } |
| 327 | *self.tasks.write().await = map; |
| 328 | // Cancellers reference live tokens — invalidate the lot. |
| 329 | self.cancellers.write().await.clear(); |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | fn now_ms() -> u64 { |