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

Method pending_confirmations

sdk/python/src/lib.rs:2404–2416  ·  view source on GitHub ↗

Return pending HITL tool confirmations for this session.

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

Source from the content-addressed store, hash-verified

2402
2403 /// Return pending HITL tool confirmations for this session.
2404 fn pending_confirmations<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyList>> {
2405 let session = self.inner.clone();
2406 let pending =
2407 py.allow_threads(move || get_runtime().block_on(session.pending_confirmations()));
2408 let json_str = serde_json::to_string(&pending)
2409 .map_err(|e| PyRuntimeError::new_err(format!("Serialization error: {e}")))?;
2410 let json_mod = py.import("json")?;
2411 let py_obj = json_mod.call_method1("loads", (json_str,))?;
2412 py_obj
2413 .downcast::<PyList>()
2414 .cloned()
2415 .map_err(|e| PyRuntimeError::new_err(format!("Unexpected result: {e}")))
2416 }
2417
2418 /// Resolve a pending HITL tool confirmation.
2419 #[pyo3(signature = (tool_id, approved, reason=None))]

Callers 1

pending_by_tool_idFunction · 0.45

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected