MCPcopy Index your code
hub / github.com/AI45Lab/Code / close_session

Method close_session

sdk/python/src/lib.rs:1377–1380  ·  view source on GitHub ↗

Close a specific live session by its session ID. Returns ``True`` when a live session with the given id was found and transitioned from open to closed by this call; ``False`` when no live session has that id, or when it was already closed.

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

Source from the content-addressed store, hash-verified

1375 /// transitioned from open to closed by this call; ``False`` when no
1376 /// live session has that id, or when it was already closed.
1377 fn close_session(&self, py: Python<'_>, session_id: String) -> bool {
1378 let agent = self.inner.clone();
1379 py.allow_threads(move || get_runtime().block_on(agent.close_session(&session_id)))
1380 }
1381
1382 /// Close every live session created from this agent and disconnect
1383 /// background resources owned by the agent (global MCP connections).

Callers 1

mainFunction · 0.45

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by 1

mainFunction · 0.36