(
coordinator: &Arc<ConversationCoordinator>,
app_state: &AppState,
session_id: &str,
workspace_path: Option<&str>,
remote_connection_id: Option<&str>,
remote_ssh_host: Option<
| 1017 | } |
| 1018 | |
| 1019 | async fn resolve_thread_goal_storage_path( |
| 1020 | coordinator: &Arc<ConversationCoordinator>, |
| 1021 | app_state: &AppState, |
| 1022 | session_id: &str, |
| 1023 | workspace_path: Option<&str>, |
| 1024 | remote_connection_id: Option<&str>, |
| 1025 | remote_ssh_host: Option<&str>, |
| 1026 | ) -> Result<PathBuf, String> { |
| 1027 | if let Some(storage_path) = coordinator |
| 1028 | .get_session_manager() |
| 1029 | .resolve_session_workspace_binding(session_id) |
| 1030 | .await |
| 1031 | .map(|binding| binding.session_storage_dir()) |
| 1032 | { |
| 1033 | return Ok(storage_path); |
| 1034 | } |
| 1035 | |
| 1036 | if let Some(workspace_path) = coordinator |
| 1037 | .get_session_manager() |
| 1038 | .get_session(session_id) |
| 1039 | .and_then(|session| session.config.workspace_path.clone()) |
| 1040 | { |
| 1041 | return Ok(PathBuf::from(workspace_path)); |
| 1042 | } |
| 1043 | |
| 1044 | let workspace_path = workspace_path |
| 1045 | .map(str::trim) |
| 1046 | .filter(|value| !value.is_empty()) |
| 1047 | .ok_or_else(|| "workspace_path is required when the session is not loaded".to_string())?; |
| 1048 | |
| 1049 | Ok(desktop_effective_session_storage_path( |
| 1050 | app_state, |
| 1051 | workspace_path, |
| 1052 | remote_connection_id, |
| 1053 | remote_ssh_host, |
| 1054 | ) |
| 1055 | .await) |
| 1056 | } |
| 1057 | |
| 1058 | #[tauri::command] |
| 1059 | pub async fn get_session_thread_goal( |
no test coverage detected