(
coordinator: State<'_, Arc<ConversationCoordinator>>,
app_state: State<'_, AppState>,
request: SetSessionThreadGoalStatusRequest,
)
| 1115 | |
| 1116 | #[tauri::command] |
| 1117 | pub async fn set_session_thread_goal_status( |
| 1118 | coordinator: State<'_, Arc<ConversationCoordinator>>, |
| 1119 | app_state: State<'_, AppState>, |
| 1120 | request: SetSessionThreadGoalStatusRequest, |
| 1121 | ) -> Result<ThreadGoal, String> { |
| 1122 | let session_id = request.session_id.trim(); |
| 1123 | if session_id.is_empty() { |
| 1124 | return Err("session_id is required".to_string()); |
| 1125 | } |
| 1126 | let status = match request.status.trim().to_ascii_lowercase().as_str() { |
| 1127 | "active" => ThreadGoalStatus::Active, |
| 1128 | "paused" => ThreadGoalStatus::Paused, |
| 1129 | "blocked" => ThreadGoalStatus::Blocked, |
| 1130 | "usageLimited" | "usage_limited" => ThreadGoalStatus::UsageLimited, |
| 1131 | "budgetLimited" | "budget_limited" => ThreadGoalStatus::BudgetLimited, |
| 1132 | "complete" => ThreadGoalStatus::Complete, |
| 1133 | other => return Err(format!("unsupported thread goal status: {other}")), |
| 1134 | }; |
| 1135 | let workspace_path = ensure_session_for_thread_goal( |
| 1136 | coordinator.inner(), |
| 1137 | app_state.inner(), |
| 1138 | session_id, |
| 1139 | request.workspace_path.as_deref(), |
| 1140 | request.remote_connection_id.as_deref(), |
| 1141 | request.remote_ssh_host.as_deref(), |
| 1142 | ) |
| 1143 | .await?; |
| 1144 | coordinator |
| 1145 | .set_thread_goal_status(session_id, workspace_path.as_path(), status) |
| 1146 | .await |
| 1147 | .map_err(|error| error.to_string()) |
| 1148 | } |
| 1149 | |
| 1150 | #[tauri::command] |
| 1151 | pub async fn update_session_thread_goal_objective( |
nothing calls this directly
no test coverage detected