MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / clear

Method clear

atomic-agent/src/turn/session.rs:567–579  ·  view source on GitHub ↗

Delete a session state file. Returns `Ok(())` if the file doesn't exist (idempotent).

(&self, session_id: &str)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

validate_session_idFunction · 0.85
session_pathMethod · 0.80
kindMethod · 0.45

Tested by

no test coverage detected