Delete a session state file. Returns `Ok(())` if the file doesn't exist (idempotent).
(&self, session_id: &str)
| 521 | /// |
| 522 | /// Returns `Ok(())` if the file doesn't exist (idempotent). |
| 523 | pub fn clear(&self, session_id: &str) -> AgentResult<()> { |
| 524 | validate_session_id(session_id)?; |
| 525 | |
| 526 | let path = self.session_path(session_id); |
| 527 | match std::fs::remove_file(&path) { |
| 528 | Ok(()) => Ok(()), |
| 529 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), |
| 530 | Err(e) => Err(AgentError::SessionSaveFailed { |
| 531 | session_id: session_id.to_string(), |
| 532 | reason: format!("delete: {}", e), |
| 533 | }), |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | /// List all stored sessions. |
| 538 | /// |
nothing calls this directly
no test coverage detected