MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / unshare_session

Method unshare_session

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

Source from the content-addressed store, hash-verified

631 }
632
633 pub fn unshare_session(&self, session_id: &str) -> anyhow::Result<bool> {
634 let url = format!("{}/session/{}/share", self.base_url, session_id);
635 let response = self.client.delete(&url).send()?;
636 if !response.status().is_success() {
637 let status = response.status();
638 let text = response.text().unwrap_or_default();
639 anyhow::bail!(
640 "Failed to unshare session `{}`: {} - {}",
641 session_id,
642 status,
643 text
644 );
645 }
646 let value = response.json::<serde_json::Value>()?;
647 Ok(value
648 .get("success")
649 .and_then(|v| v.as_bool())
650 .unwrap_or(true))
651 }
652
653 pub fn compact_session(&self, session_id: &str) -> anyhow::Result<CompactResponse> {
654 let url = format!("{}/session/{}/compact", self.base_url, session_id);

Callers 1

Calls 5

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

Tested by

no test coverage detected