(config: CliConfig, session_id: String)
| 717 | } |
| 718 | |
| 719 | async fn run_interactive_with_session(config: CliConfig, session_id: String) -> Result<()> { |
| 720 | let mut terminal = ui::init_terminal()?; |
| 721 | ui::render_loading(&mut terminal, "Initializing system, please wait...")?; |
| 722 | |
| 723 | let workspace = setup_workspace(); |
| 724 | let (agentic_system, original_skip_confirmation) = initialize_core_services(true).await?; |
| 725 | let workspace_path = workspace |
| 726 | .clone() |
| 727 | .map(PathBuf::from) |
| 728 | .or_else(|| std::env::current_dir().ok()) |
| 729 | .unwrap_or_else(|| PathBuf::from(".")); |
| 730 | let session = agentic_system |
| 731 | .coordinator |
| 732 | .restore_session(&workspace_path, &session_id) |
| 733 | .await?; |
| 734 | |
| 735 | let mut chat_mode = ChatMode::new(config, session.agent_type, workspace, &agentic_system) |
| 736 | .with_restore_session(session_id); |
| 737 | let run_result = chat_mode.run(Some(terminal)); |
| 738 | |
| 739 | shutdown_mcp_servers().await; |
| 740 | restore_tool_confirmation(original_skip_confirmation).await; |
| 741 | println!("Goodbye!"); |
| 742 | |
| 743 | run_result?; |
| 744 | Ok(()) |
| 745 | } |
| 746 | |
| 747 | fn main() { |
| 748 | let worker = std::thread::Builder::new() |
no test coverage detected