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

Function select_session

crates/opencode-server/src/routes.rs:3909–3926  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
    Json(req): Json<SelectSessionRequest>,
)

Source from the content-addressed store, hash-verified

3907}
3908
3909async fn select_session(
3910 State(state): State<Arc<ServerState>>,
3911 Json(req): Json<SelectSessionRequest>,
3912) -> Result<Json<bool>> {
3913 let sessions = state.sessions.lock().await;
3914 if sessions.get(&req.session_id).is_none() {
3915 return Err(ApiError::SessionNotFound(req.session_id));
3916 }
3917 drop(sessions);
3918
3919 enqueue_tui_request(
3920 &state,
3921 "/tui/select-session",
3922 serde_json::json!({ "sessionID": req.session_id }),
3923 )
3924 .await;
3925 Ok(Json(true))
3926}
3927
3928#[derive(Debug, Serialize)]
3929pub struct TuiRequest {

Callers

nothing calls this directly

Calls 2

enqueue_tui_requestFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected