Return snapshots of subagent tasks still in `running` state.
(&self, py: Python<'_>)
| 1881 | |
| 1882 | /// Return snapshots of subagent tasks still in `running` state. |
| 1883 | fn pending_subagent_tasks(&self, py: Python<'_>) -> PyResult<PyObject> { |
| 1884 | let session = self.inner.clone(); |
| 1885 | let tasks = |
| 1886 | py.allow_threads(move || get_runtime().block_on(session.pending_subagent_tasks())); |
| 1887 | let json = serde_json::to_string(&tasks).map_err(|e| { |
| 1888 | PyRuntimeError::new_err(format!("Failed to serialize pending subagent tasks: {e}")) |
| 1889 | })?; |
| 1890 | json_string_to_py(py, &json) |
| 1891 | } |
| 1892 | |
| 1893 | /// Cancel an in-flight subagent task by id. Returns True when a |
| 1894 | /// cancellation token was found and fired, False when the task id is |