fix: trace gated automation bootstrap

This commit is contained in:
codex
2026-08-03 16:41:15 +03:00
parent 544b329077
commit 8a1735408a
2 changed files with 4 additions and 0 deletions
@@ -39,6 +39,7 @@ internal static class FirstLimitedApplyAutomationBootstrap
if (state != BootstrapState.Created) return;
state = BootstrapState.Prepared;
AcadApplication.Idle += OnIdle;
RuntimeDiagnostics.Write("AutomationBootstrapSubscribed", resultStatus: "Prepared");
}
// Public test command is intentionally side-effect free with respect to Plant APIs.
@@ -52,6 +53,7 @@ internal static class FirstLimitedApplyAutomationBootstrap
try
{
idleCallbackCount++;
RuntimeDiagnostics.Write("AutomationBootstrapIdle", resultStatus: state.ToString());
// The script engine can consume the custom command after NETLOAD. The
// first idle is therefore the explicit post-NETLOAD arming point.
if (state == BootstrapState.Prepared) { observedIdle = true; state = BootstrapState.Armed; }
@@ -59,6 +61,7 @@ internal static class FirstLimitedApplyAutomationBootstrap
state = BootstrapState.Starting;
AcadApplication.Idle -= OnIdle;
coordinatorStartCount++;
RuntimeDiagnostics.Write("AutomationCoordinatorStarting", resultStatus: "FirstPostStartupIdle");
new FirstLimitedApplyAutomationCoordinator().Start();
}
catch (System.Exception exception)