@@ -270,8 +270,8 @@ impl<A: API + 'static, F: Fn() -> A + Send + Sync> UI<A, F> {
270270 }
271271
272272 async fn run_inner ( & mut self ) -> Result < ( ) > {
273- if let Some ( mcp ) = self . cli . subcommands . clone ( ) {
274- return self . handle_subcommands ( mcp ) . await ;
273+ if let Some ( cmd ) = self . cli . subcommands . clone ( ) {
274+ return self . handle_subcommands ( cmd ) . await ;
275275 }
276276
277277 // Display the banner in dimmed colors since we're in interactive mode
@@ -2291,7 +2291,6 @@ impl<A: API + 'static, F: Fn() -> A + Send + Sync> UI<A, F> {
22912291 let workflow = self . api . read_workflow ( self . cli . workflow . as_deref ( ) ) . await ?;
22922292
22932293 let _ = self . handle_migrate_credentials ( ) . await ;
2294- self . install_vscode_extension ( ) ;
22952294
22962295 // Ensure we have a model selected before proceeding with initialization
22972296 let active_agent = self . api . get_active_agent ( ) . await ;
@@ -2361,6 +2360,8 @@ impl<A: API + 'static, F: Fn() -> A + Send + Sync> UI<A, F> {
23612360 async fn on_message ( & mut self , content : Option < String > ) -> Result < ( ) > {
23622361 let conversation_id = self . init_conversation ( ) . await ?;
23632362
2363+ self . install_vscode_extension ( ) ;
2364+
23642365 // Track if content was provided to decide whether to use piped input as
23652366 // additional context
23662367 let has_content = content. is_some ( ) ;
@@ -3107,6 +3108,9 @@ impl<A: API + 'static, F: Fn() -> A + Send + Sync> UI<A, F> {
31073108
31083109 /// Silently install VS Code extension if in VS Code and extension not
31093110 /// installed.
3111+ /// NOTE: This is a non-cancellable and a slow task. We should only run this
3112+ /// if the user has provided a prompt because that is guaranteed to run for
3113+ /// at least a few seconds.
31103114 fn install_vscode_extension ( & self ) {
31113115 tokio:: task:: spawn_blocking ( || {
31123116 if crate :: vscode:: should_install_extension ( ) {
0 commit comments