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

Method close

core/src/agent_api.rs:478–480  ·  view source on GitHub ↗

Close every live session created from this agent and tear down background resources owned by the agent (global MCP connections). After this call: - Every live `AgentSession` is closed (same effect as calling [`AgentSession::close`] on each). - Subsequent [`Agent::session`] / [`Agent::resume_session`] calls fail fast with [`CodeError::SessionClosed`](crate::error::CodeError::SessionClosed). Idemp

(&self)

Source from the content-addressed store, hash-verified

476 /// Idempotent: subsequent calls are no-ops and are guaranteed not to
477 /// panic.
478 pub async fn close(&self) {
479 agent_sessions::close_agent(self).await
480 }
481
482 /// Return whether [`close`](Self::close) has been called on this agent.
483 pub fn is_closed(&self) -> bool {

Callers

nothing calls this directly

Calls 1

close_agentFunction · 0.85

Tested by

no test coverage detected