(
coordinator: State<'_, Arc<ConversationCoordinator>>,
app_state: State<'_, AppState>,
startup_trace: State<'_, DesktopStartupTrace>,
request: GetSessionThreadGoalRequest,
)
| 1057 | |
| 1058 | #[tauri::command] |
| 1059 | pub async fn get_session_thread_goal( |
| 1060 | coordinator: State<'_, Arc<ConversationCoordinator>>, |
| 1061 | app_state: State<'_, AppState>, |
| 1062 | startup_trace: State<'_, DesktopStartupTrace>, |
| 1063 | request: GetSessionThreadGoalRequest, |
| 1064 | ) -> Result<GetSessionThreadGoalResponse, String> { |
| 1065 | let trace_started = Instant::now(); |
| 1066 | let result = async { |
| 1067 | let session_id = request.session_id.trim(); |
| 1068 | if session_id.is_empty() { |
| 1069 | return Err("session_id is required".to_string()); |
| 1070 | } |
| 1071 | let storage_path = resolve_thread_goal_storage_path( |
| 1072 | coordinator.inner(), |
| 1073 | app_state.inner(), |
| 1074 | session_id, |
| 1075 | request.workspace_path.as_deref(), |
| 1076 | request.remote_connection_id.as_deref(), |
| 1077 | request.remote_ssh_host.as_deref(), |
| 1078 | ) |
| 1079 | .await?; |
| 1080 | let goal = coordinator |
| 1081 | .get_thread_goal(session_id, storage_path.as_path()) |
| 1082 | .await |
| 1083 | .map_err(|error| error.to_string())?; |
| 1084 | Ok(GetSessionThreadGoalResponse { goal }) |
| 1085 | } |
| 1086 | .await; |
| 1087 | startup_trace.record_tauri_command_elapsed("get_session_thread_goal", None, trace_started); |
| 1088 | result |
| 1089 | } |
| 1090 | |
| 1091 | #[tauri::command] |
| 1092 | pub async fn clear_session_thread_goal( |
nothing calls this directly
no test coverage detected