Delete a session state file. Returns `Ok(())` if the file doesn't exist (idempotent).
(&self, session_id: &str)
| 549 | /// |
| 550 | /// Returns `Ok(())` if the file doesn't exist (idempotent). |
| 551 | pub fn clear(&self, session_id: &str) -> AgentResult<()> { |
| 552 | validate_session_id(session_id)?; |
| 553 | |
| 554 | let path = self.session_path(session_id); |
| 555 | match std::fs::remove_file(&path) { |
| 556 | Ok(()) => Ok(()), |
| 557 | Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()), |
| 558 | Err(e) => Err(AgentError::SessionSaveFailed { |
| 559 | session_id: session_id.to_string(), |
| 560 | reason: format!("delete: {}", e), |
| 561 | }), |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | /// List all stored sessions. |
| 566 | /// |
nothing calls this directly
no test coverage detected