@@ -205,7 +205,7 @@ async fn run(cli: Cli) -> tracedecay::errors::Result<()> {
205205 } ;
206206
207207 maybe_run_extract_worker ( & command) ;
208- run_startup_preamble ( & command) ;
208+ run_startup_preamble ( & command) . await ;
209209 dispatch_command ( command) . await
210210}
211211
@@ -219,7 +219,7 @@ fn maybe_run_extract_worker(command: &Commands) {
219219 }
220220}
221221
222- fn run_startup_preamble ( command : & Commands ) {
222+ async fn run_startup_preamble ( command : & Commands ) {
223223 let skip_startup_maintenance = should_skip_startup_maintenance ( command) ;
224224 let skip_agent_install_maintenance = should_skip_agent_install_maintenance ( command) ;
225225
@@ -257,7 +257,7 @@ fn run_startup_preamble(command: &Commands) {
257257 // Best-effort check: warn if install needs re-running.
258258 if !skip_agent_install_maintenance {
259259 tracedecay:: agents:: claude:: check_install_stale ( ) ;
260- maybe_run_silent_reinstall ( & mut user_config) ;
260+ maybe_run_silent_reinstall ( & mut user_config) . await ;
261261 }
262262}
263263
@@ -311,12 +311,12 @@ fn silent_reinstall_action(
311311 }
312312}
313313
314- fn maybe_run_silent_reinstall ( user_config : & mut tracedecay:: user_config:: UserConfig ) {
314+ async fn maybe_run_silent_reinstall ( user_config : & mut tracedecay:: user_config:: UserConfig ) {
315315 // Silent reinstall: re-run install for every tracked agent so permissions,
316316 // hooks, and MCP config stay in sync with the new binary.
317317 let running = env ! ( "CARGO_PKG_VERSION" ) ;
318318 match silent_reinstall_action ( user_config, running) {
319- SilentReinstallAction :: Reinstall => run_silent_reinstall ( user_config, running) ,
319+ SilentReinstallAction :: Reinstall => run_silent_reinstall ( user_config, running) . await ,
320320 SilentReinstallAction :: AdvanceMarker => {
321321 user_config. previous_version = running. to_string ( ) ;
322322 user_config. save ( ) ;
@@ -325,8 +325,13 @@ fn maybe_run_silent_reinstall(user_config: &mut tracedecay::user_config::UserCon
325325 }
326326}
327327
328- fn run_silent_reinstall ( user_config : & mut tracedecay:: user_config:: UserConfig , running : & str ) {
329- if update_cmd:: reinstall_tracked_agents ( user_config) {
328+ async fn run_silent_reinstall (
329+ user_config : & mut tracedecay:: user_config:: UserConfig ,
330+ running : & str ,
331+ ) {
332+ if let update_cmd:: ReinstallOutcome :: AllOk =
333+ update_cmd:: reinstall_tracked_agents ( user_config) . await
334+ {
330335 user_config. mark_version_installed ( running) ;
331336 user_config. save ( ) ;
332337 }
@@ -561,14 +566,23 @@ async fn dispatch_command(command: Commands) -> tracedecay::errors::Result<()> {
561566 print ! ( "{}" , tracedecay:: daemon:: service_status( & socket_path) ) ;
562567 }
563568 } ,
564- Commands :: Upgrade { no_heal } => {
565- update_cmd:: run_upgrade_command ( no_heal) ?;
569+ Commands :: Upgrade {
570+ no_heal,
571+ no_reinstall,
572+ } => {
573+ update_cmd:: run_upgrade_command ( no_heal, no_reinstall) ?;
566574 }
567- Commands :: Update { no_heal } => {
568- update_cmd:: run_update_command ( no_heal) ?;
575+ Commands :: Update {
576+ no_heal,
577+ no_reinstall,
578+ } => {
579+ update_cmd:: run_update_command ( no_heal, no_reinstall) ?;
569580 }
570- Commands :: PostUpdate { no_heal } => {
571- update_cmd:: run_post_update_tasks ( no_heal) . await ?;
581+ Commands :: PostUpdate {
582+ no_heal,
583+ no_reinstall,
584+ } => {
585+ update_cmd:: run_post_update_tasks ( no_heal, no_reinstall) . await ?;
572586 }
573587 Commands :: Channel { channel } => match channel {
574588 Some ( target) => {
0 commit comments