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)
| 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). |