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

Method update_session_title

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

Source from the content-addressed store, hash-verified

339 }
340
341 pub fn update_session_title(
342 &self,
343 session_id: &str,
344 title: &str,
345 ) -> anyhow::Result<SessionInfo> {
346 let url = format!("{}/session/{}", self.base_url, session_id);
347 let request = UpdateSessionRequest {
348 title: Some(title.to_string()),
349 };
350 let response = self.client.patch(&url).json(&request).send()?;
351 if !response.status().is_success() {
352 let status = response.status();
353 let text = response.text().unwrap_or_default();
354 anyhow::bail!(
355 "Failed to update session `{}` title: {} - {}",
356 session_id,
357 status,
358 text
359 );
360 }
361 let session: SessionInfo = response.json()?;
362 Ok(session)
363 }
364
365 pub fn delete_session(&self, session_id: &str) -> anyhow::Result<bool> {
366 let url = format!("{}/session/{}", self.base_url, session_id);

Callers 1

handle_dialog_keyMethod · 0.80

Calls 3

sendMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected