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

Method close_session

core/src/agent_api.rs:463–465  ·  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 the session was already closed. This is the out-of-band counterpart to [`AgentSession::close`]: it performs exactly the same cleanup but can be invoked without holding a reference to th

(&self, session_id: &str)

Source from the content-addressed store, hash-verified

461 /// a reference to the session itself — useful for control-plane code
462 /// that only knows the session ID.
463 pub async fn close_session(&self, session_id: &str) -> bool {
464 agent_sessions::close_session(self, session_id).await
465 }
466
467 /// Close every live session created from this agent and tear down
468 /// background resources owned by the agent (global MCP connections).

Calls 1

close_sessionFunction · 0.85