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

Method current_run

sdk/python/src/lib.rs:1834–1847  ·  view source on GitHub ↗

Return the currently running operation, or None when idle.

(&self, py: Python<'_>)

Source from the content-addressed store, hash-verified

1832
1833 /// Return the currently running operation, or None when idle.
1834 fn current_run(&self, py: Python<'_>) -> PyResult<PyObject> {
1835 let session = self.inner.clone();
1836 let snapshot = py.allow_threads(move || {
1837 get_runtime().block_on(async move {
1838 match session.current_run().await {
1839 Some(run) => run.snapshot().await,
1840 None => None,
1841 }
1842 })
1843 });
1844 let json = serde_json::to_string(&snapshot)
1845 .map_err(|e| PyRuntimeError::new_err(format!("Failed to serialize run: {e}")))?;
1846 json_string_to_py(py, &json)
1847 }
1848
1849 /// Return active tool calls observed for the currently running operation.
1850 fn active_tools(&self, py: Python<'_>) -> PyResult<PyObject> {

Callers

nothing calls this directly

Calls 5

json_string_to_pyFunction · 0.85
block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45
snapshotMethod · 0.45

Tested by

no test coverage detected