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

Method compact_session

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

Source from the content-addressed store, hash-verified

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);
655 let response = self.client.post(&url).send()?;
656 if !response.status().is_success() {
657 let status = response.status();
658 let text = response.text().unwrap_or_default();
659 anyhow::bail!(
660 "Failed to compact session `{}`: {} - {}",
661 session_id,
662 status,
663 text
664 );
665 }
666 Ok(response.json::<CompactResponse>()?)
667 }
668
669 pub fn revert_session(
670 &self,

Callers 1

Calls 3

sendMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected