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

Function resolve_thread_goal_storage_path

src/apps/desktop/src/api/agentic_api.rs:1019–1056  ·  view source on GitHub ↗
(
    coordinator: &Arc<ConversationCoordinator>,
    app_state: &AppState,
    session_id: &str,
    workspace_path: Option<&str>,
    remote_connection_id: Option<&str>,
    remote_ssh_host: Option<

Source from the content-addressed store, hash-verified

1017}
1018
1019async 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]
1059pub async fn get_session_thread_goal(

Callers 1

get_session_thread_goalFunction · 0.85

Calls 7

get_session_managerMethod · 0.80
session_storage_dirMethod · 0.80
get_sessionMethod · 0.45
cloneMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected