Delete a session state file. Returns `Ok(())` if the file doesn't exist (idempotent).
(&self, session_id: &str)
| 565 | /// |
| 566 | /// Returns `Ok(())` if the file doesn't exist (idempotent). |
| 567 | pub fn clear(&self, session_id: &str) -> AgentResult<()> { |
| 568 | validate_session_id(session_id)?; |
| 569 | |
| 570 | let path = self.session_path(session_id); |
| 571 | match std::fs::remove_file(&path) { |
| 572 | Ok(()) => Ok(()), |
| 573 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), |
| 574 | Err(e) => Err(AgentError::SessionSaveFailed { |
| 575 | session_id: session_id.to_string(), |
| 576 | reason: format!("delete: {}", e), |
| 577 | }), |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | /// List all stored sessions. |
| 582 | /// |
nothing calls this directly
no test coverage detected