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

Function get_session_thread_goal

src/apps/desktop/src/api/agentic_api.rs:1059–1089  ·  view source on GitHub ↗
(
    coordinator: State<'_, Arc<ConversationCoordinator>>,
    app_state: State<'_, AppState>,
    startup_trace: State<'_, DesktopStartupTrace>,
    request: GetSessionThreadGoalRequest,
)

Source from the content-addressed store, hash-verified

1057
1058#[tauri::command]
1059pub 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]
1092pub async fn clear_session_thread_goal(

Callers

nothing calls this directly

Calls 5

trimMethod · 0.80
is_emptyMethod · 0.45
get_thread_goalMethod · 0.45

Tested by

no test coverage detected