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

Function delete_session

crates/opencode-server/src/routes.rs:428–441  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
    Path(id): Path<String>,
)

Source from the content-addressed store, hash-verified

426}
427
428async fn delete_session(
429 State(state): State<Arc<ServerState>>,
430 Path(id): Path<String>,
431) -> Result<Json<serde_json::Value>> {
432 state
433 .sessions
434 .lock()
435 .await
436 .delete(&id)
437 .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?;
438 SESSION_RUN_STATUS.write().await.remove(&id);
439 persist_sessions_if_enabled(&state).await;
440 Ok(Json(serde_json::json!({ "deleted": true })))
441}
442
443async fn get_session_children(
444 State(state): State<Arc<ServerState>>,

Callers

nothing calls this directly

Calls 4

deleteMethod · 0.45
cloneMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected