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

Function list_messages

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

Source from the content-addressed store, hash-verified

1096}
1097
1098async fn list_messages(
1099 State(state): State<Arc<ServerState>>,
1100 Path(session_id): Path<String>,
1101) -> Result<Json<Vec<MessageInfo>>> {
1102 let sessions = state.sessions.lock().await;
1103 let session = sessions
1104 .get(&session_id)
1105 .ok_or_else(|| ApiError::SessionNotFound(session_id.clone()))?;
1106 Ok(Json(
1107 session
1108 .messages
1109 .iter()
1110 .map(|m| message_to_info(&session_id, m))
1111 .collect(),
1112 ))
1113}
1114
1115async fn delete_message(
1116 State(state): State<Arc<ServerState>>,

Callers

nothing calls this directly

Calls 3

message_to_infoFunction · 0.85
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected