fix: keep pilot automation host alive

This commit is contained in:
codex
2026-08-10 11:16:39 +03:00
parent 1f5853de86
commit 6f7888b18b
+10 -1
View File
@@ -28,7 +28,16 @@ public partial class App : System.Windows.Application
catch (Exception exception) { System.Windows.MessageBox.Show("Controlled local configuration blocked: " + exception.Message, "Launcher Next"); Shutdown(2); } catch (Exception exception) { System.Windows.MessageBox.Show("Controlled local configuration blocked: " + exception.Message, "Launcher Next"); Shutdown(2); }
return; return;
} }
if (e.Args.FirstOrDefault()?.Equals("pilot", StringComparison.OrdinalIgnoreCase) == true) { Shutdown(await PilotCli.RunAsync(e.Args.Skip(1).ToArray())); return; } if (e.Args.FirstOrDefault()?.Equals("pilot", StringComparison.OrdinalIgnoreCase) == true)
{
// A pilot command is asynchronous and owns no WPF window. Without an
// explicit shutdown mode the dispatcher may terminate at its first
// await, after the Preview child has been started but before Apply
// and its evidence/rollback boundary have run.
ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
Shutdown(await PilotCli.RunAsync(e.Args.Skip(1).ToArray()));
return;
}
new MainWindow().Show(); new MainWindow().Show();
} }
} }