(&self, session_id: &str, agent_type: &str)
| 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 |
no test coverage detected