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

Function start_compaction

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

Source from the content-addressed store, hash-verified

692}
693
694async fn start_compaction(
695 State(state): State<Arc<ServerState>>,
696 Path(id): Path<String>,
697) -> Result<Json<SessionInfo>> {
698 let mut sessions = state.sessions.lock().await;
699 let session = sessions
700 .get_mut(&id)
701 .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?;
702 session.start_compacting();
703 let info = session_to_info(session);
704 drop(sessions);
705 persist_sessions_if_enabled(&state).await;
706 Ok(Json(info))
707}
708
709#[derive(Debug, Deserialize)]
710pub struct SendMessageRequest {

Callers

nothing calls this directly

Calls 5

session_to_infoFunction · 0.85
start_compactingMethod · 0.80
get_mutMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected