MCPcopy Create free account
hub / github.com/GCWing/BitFun / restore_session

Function restore_session

src/apps/desktop/src/api/agentic_api.rs:1736–1760  ·  view source on GitHub ↗
(
    coordinator: State<'_, Arc<ConversationCoordinator>>,
    app_state: State<'_, AppState>,
    request: RestoreSessionRequest,
)

Source from the content-addressed store, hash-verified

1734
1735#[tauri::command]
1736pub async fn restore_session(
1737 coordinator: State<'_, Arc<ConversationCoordinator>>,
1738 app_state: State<'_, AppState>,
1739 request: RestoreSessionRequest,
1740) -> Result<SessionResponse, String> {
1741 let effective_path = desktop_effective_session_storage_path(
1742 &app_state,
1743 &request.workspace_path,
1744 request.remote_connection_id.as_deref(),
1745 request.remote_ssh_host.as_deref(),
1746 )
1747 .await;
1748 let session = if request.include_internal {
1749 coordinator
1750 .restore_internal_session_from_storage_path(&effective_path, &request.session_id)
1751 .await
1752 } else {
1753 coordinator
1754 .restore_session_from_storage_path(&effective_path, &request.session_id)
1755 .await
1756 }
1757 .map_err(|e| format!("Failed to restore session: {}", e))?;
1758
1759 Ok(session_to_response(session))
1760}
1761
1762#[tauri::command]
1763pub async fn restore_session_view(

Callers

nothing calls this directly

Tested by

no test coverage detected