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)
| 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 { |
nothing calls this directly
no test coverage detected