@@ -408,6 +408,7 @@ impl ActiveView {
408408
409409pub struct AgentPanel {
410410 workspace : WeakEntity < Workspace > ,
411+ loading : bool ,
411412 user_store : Entity < UserStore > ,
412413 project : Entity < Project > ,
413414 fs : Arc < dyn Fs > ,
@@ -513,6 +514,7 @@ impl AgentPanel {
513514 cx,
514515 )
515516 } ) ;
517+ panel. as_mut ( cx) . loading = true ;
516518 if let Some ( serialized_panel) = serialized_panel {
517519 panel. update ( cx, |panel, cx| {
518520 panel. width = serialized_panel. width . map ( |w| w. round ( ) ) ;
@@ -527,6 +529,7 @@ impl AgentPanel {
527529 panel. new_agent_thread ( AgentType :: NativeAgent , window, cx) ;
528530 } ) ;
529531 }
532+ panel. as_mut ( cx) . loading = false ;
530533 panel
531534 } ) ?;
532535
@@ -726,6 +729,7 @@ impl AgentPanel {
726729 acp_history,
727730 acp_history_store,
728731 selected_agent : AgentType :: default ( ) ,
732+ loading : false ,
729733 }
730734 }
731735
@@ -857,6 +861,7 @@ impl AgentPanel {
857861 agent : crate :: ExternalAgent ,
858862 }
859863
864+ let loading = self . loading ;
860865 let history = self . acp_history_store . clone ( ) ;
861866
862867 cx. spawn_in ( window, async move |this, cx| {
@@ -898,7 +903,9 @@ impl AgentPanel {
898903 }
899904 } ;
900905
901- telemetry:: event!( "Agent Thread Started" , agent = ext_agent. name( ) ) ;
906+ if !loading {
907+ telemetry:: event!( "Agent Thread Started" , agent = ext_agent. name( ) ) ;
908+ }
902909
903910 let server = ext_agent. server ( fs, history) ;
904911
0 commit comments