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

Function run_interactive_with_session

src/apps/cli/src/main.rs:719–745  ·  view source on GitHub ↗
(config: CliConfig, session_id: String)

Source from the content-addressed store, hash-verified

717}
718
719async 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
747fn main() {
748 let worker = std::thread::Builder::new()

Callers 1

run_cliFunction · 0.85

Calls 11

init_terminalFunction · 0.85
render_loadingFunction · 0.85
setup_workspaceFunction · 0.85
initialize_core_servicesFunction · 0.85
shutdown_mcp_serversFunction · 0.85
with_restore_sessionMethod · 0.80
cloneMethod · 0.45
okMethod · 0.45
restore_sessionMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected