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

Function clear_session_revert

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

Source from the content-addressed store, hash-verified

678}
679
680async fn clear_session_revert(
681 State(state): State<Arc<ServerState>>,
682 Path(id): Path<String>,
683) -> Result<Json<SessionInfo>> {
684 let mut sessions = state.sessions.lock().await;
685 let updated = sessions
686 .clear_revert(&id)
687 .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?;
688 let info = session_to_info(&updated);
689 drop(sessions);
690 persist_sessions_if_enabled(&state).await;
691 Ok(Json(info))
692}
693
694async fn start_compaction(
695 State(state): State<Arc<ServerState>>,

Callers

nothing calls this directly

Calls 4

session_to_infoFunction · 0.85
clear_revertMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected