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

Method recreate_session_with_id

src/apps/cli/src/agent/core_adapter.rs:88–114  ·  view source on GitHub ↗
(&self, session_id: &str, agent_type: &str)

Source from the content-addressed store, hash-verified

86 }
87
88 async fn recreate_session_with_id(&self, session_id: &str, agent_type: &str) -> Result<()> {
89 let mut session_name = Self::build_default_session_name();
90 let mut effective_agent_type = agent_type.to_string();
91
92 let workspace = self.workspace_path_buf();
93 if let Ok(sessions) = self.coordinator.list_sessions(&workspace).await {
94 if let Some(summary) = sessions.iter().find(|s| s.session_id == session_id) {
95 session_name = summary.session_name.clone();
96 effective_agent_type = summary.agent_type.clone();
97 }
98 }
99
100 self.coordinator
101 .create_session_with_id(
102 Some(session_id.to_string()),
103 session_name,
104 effective_agent_type,
105 SessionConfig {
106 workspace_path: Some(self.workspace_path_string()),
107 ..Default::default()
108 },
109 )
110 .await?;
111
112 tracing::info!("Recreated backend session with existing id: {}", session_id);
113 Ok(())
114 }
115
116 async fn ensure_backend_session_alive(&self, session_id: &str, agent_type: &str) -> Result<()> {
117 if self

Callers 1

Calls 6

iterMethod · 0.80
workspace_path_stringMethod · 0.80
workspace_path_bufMethod · 0.45
list_sessionsMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected