MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / delete_session

Method delete_session

crates/opencode-tui/src/api.rs:365–383  ·  view source on GitHub ↗
(&self, session_id: &str)

Source from the content-addressed store, hash-verified

363 }
364
365 pub fn delete_session(&self, session_id: &str) -> anyhow::Result<bool> {
366 let url = format!("{}/session/{}", self.base_url, session_id);
367 let response = self.client.delete(&url).send()?;
368 if !response.status().is_success() {
369 let status = response.status();
370 let text = response.text().unwrap_or_default();
371 anyhow::bail!(
372 "Failed to delete session `{}`: {} - {}",
373 session_id,
374 status,
375 text
376 );
377 }
378 let value = response.json::<serde_json::Value>()?;
379 Ok(value
380 .get("deleted")
381 .and_then(|v| v.as_bool())
382 .unwrap_or(true))
383 }
384
385 pub fn send_prompt(
386 &self,

Callers 1

handle_dialog_keyMethod · 0.45

Calls 5

sendMethod · 0.45
deleteMethod · 0.45
statusMethod · 0.45
textMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected