Look up a delegated subagent task by id. Returns None when no such task has been observed in this session.
(&self, py: Python<'_>, task_id: String)
| 1859 | /// Look up a delegated subagent task by id. Returns None when no such |
| 1860 | /// task has been observed in this session. |
| 1861 | fn subagent_task(&self, py: Python<'_>, task_id: String) -> PyResult<PyObject> { |
| 1862 | let session = self.inner.clone(); |
| 1863 | let snapshot = |
| 1864 | py.allow_threads(move || get_runtime().block_on(session.subagent_task(&task_id))); |
| 1865 | let json = serde_json::to_string(&snapshot).map_err(|e| { |
| 1866 | PyRuntimeError::new_err(format!("Failed to serialize subagent task: {e}")) |
| 1867 | })?; |
| 1868 | json_string_to_py(py, &json) |
| 1869 | } |
| 1870 | |
| 1871 | /// Return snapshots of every delegated subagent task observed in this |
| 1872 | /// session (including completed and failed ones), oldest first. |