Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Honor local Patrol preflight deadlines
rcourtman0bacc727da8d
diff --git a/docs/AI_PATROL_QUALIFICATION.md b/docs/AI_PATROL_QUALIFICATION.mdindex 3027d01709..8a17200749 100644--- a/docs/AI_PATROL_QUALIFICATION.md+++ b/docs/AI_PATROL_QUALIFICATION.md@@ -323,22 +323,26 @@ On 2026-07-20, the disposable Windows CLI harness was exercised on an RTX 3070| State | Result ||---|---|| First-ever disk/GPU cold request | completed in 40.056 seconds; model load was 19.923 seconds and initial prompt evaluation was 20.122 seconds |-| First-ever cold Patrol preflight | correctly classified `provider_connection` at the preflight-specific 30.002-second diagnostic deadline |+| First-ever cold Patrol preflight (historical 30-second policy) | correctly classified `provider_connection` at the then-current 30.002-second diagnostic deadline || Memory-cold streamed request after OS cache warmup | first provider event at 13.892 seconds || Memory-cold Patrol preflight, three independent unloads | passed with native tool calls in 15.695, 15.953, and 15.556 seconds || Warm Patrol preflight | four native-tool-call passes: 10.536 seconds initially, then 2.501, 2.028, and 1.943 seconds |-The 30-second preflight is a configuration diagnostic and is deliberately-shorter than the normal Patrol provider request bound. The initial preflight-failure therefore remains a provider/runtime result, not evidence that the-accepted manual run failed to start. The deterministic browser regression-matrix above supplies exact 0/15/30/60-second acceptance coverage; this live-run proves the selected local model and representative hardware actually-exercise both the roughly-15-second and 30–60-second cold-start classes.+That first-ever cold result records the historical 30-second policy. Current+Ollama and custom OpenAI-compatible preflights use the configured provider+request timeout so a permitted cold local-model load is not misclassified at a+hosted-provider deadline. The deterministic browser regression matrix above+supplies exact 0/15/30/60-second acceptance coverage; this live run proves the+selected local model and representative hardware actually exercise both the+roughly-15-second and 30–60-second cold-start classes.`live-suite` selects every checked-in scenario for the requested track. Theremediation track still requires `--authorize-remediation`; selecting the-track does not broaden mutation authority.+track does not broaden mutation authority. Suite acquisition waits through the+selected route's complete preflight deadline plus bounded cache-publication+grace before restoring a temporary model override. Hosted API routes keep the+short acquisition bound; local subscription, Ollama, and custom+OpenAI-compatible routes keep their longer route-aware bound.An SSH Docker host is allowed only for a manifest-approved shared lab:diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex b358063e0d..c0879d2e54 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -386,11 +386,13 @@ the configured request timeout and prompt/output size limits, with a two-minuteminimum request allowance for local subscription turns. Patrol tool-callpreflight owns one route-aware outer deadline: API providers retain the30-second budget, while local subscription agents receive a bounded two-minute-budget for CLI startup and complete structured-output assembly. A caller's-earlier cancellation still wins. Qualification waits through that complete-subscription-agent deadline plus bounded cache-publication grace before it may-classify missing fresh preflight evidence; its shorter API-provider wait must-not truncate a healthy local CLI turn. The native provider boundary accepts the+budget for CLI startup and complete structured-output assembly, and Ollama or a+custom OpenAI-compatible endpoint receives the configured provider request+timeout for cold local-model loading. A caller's earlier cancellation still+wins. Qualification waits through the applicable local-provider deadline plus+bounded cache-publication grace before it may classify missing fresh preflight+evidence; its shorter hosted API-provider wait must not truncate a healthy+local CLI or local-model turn. The native provider boundary accepts thecanonical qualified Pulse model identity from shared callers, strips only itsown subscription-provider prefix before CLI execution, and rejects foreignprovider prefixes rather than forwarding an invalid or cross-provider model@@ -873,7 +875,11 @@ for one explicit track, but it must acquire and freshly preflight one exactprovider/model route before provisioning any scenario, retain that route forevery repetition, and restore it once after the complete suite. Scenariorunners assert the leased route and must not rewrite model settings or trigger-their own provider preflights. A fresh suite preflight failure aborts setup once+their own provider preflights. The suite acquisition deadline must mirror the+runtime's route-aware preflight deadline, including the configured request+timeout for Ollama and custom OpenAI-compatible endpoints, plus bounded cache+publication grace; it must not restore a changed route while a permitted cold+local-model preflight is still running. A fresh suite preflight failure aborts setup onceas qualification-infrastructure evidence; cached failure state must never berecounted as multiple model or scenario failures without independent providerinvocations. `live-suite` must retain the existing live-fault and separatediff --git a/frontend-modern/public/docs/AI_PATROL_QUALIFICATION.md b/frontend-modern/public/docs/AI_PATROL_QUALIFICATION.mdindex 3027d01709..8a17200749 100644--- a/frontend-modern/public/docs/AI_PATROL_QUALIFICATION.md+++ b/frontend-modern/public/docs/AI_PATROL_QUALIFICATION.md@@ -323,22 +323,26 @@ On 2026-07-20, the disposable Windows CLI harness was exercised on an RTX 3070| State | Result ||---|---|| First-ever disk/GPU cold request | completed in 40.056 seconds; model load was 19.923 seconds and initial prompt evaluation was 20.122 seconds |-| First-ever cold Patrol preflight | correctly classified `provider_connection` at the preflight-specific 30.002-second diagnostic deadline |+| First-ever cold Patrol preflight (historical 30-second policy) | correctly classified `provider_connection` at the then-current 30.002-second diagnostic deadline || Memory-cold streamed request after OS cache warmup | first provider event at 13.892 seconds || Memory-cold Patrol preflight, three independent unloads | passed with native tool calls in 15.695, 15.953, and 15.556 seconds || Warm Patrol preflight | four native-tool-call passes: 10.536 seconds initially, then 2.501, 2.028, and 1.943 seconds |-The 30-second preflight is a configuration diagnostic and is deliberately-shorter than the normal Patrol provider request bound. The initial preflight-failure therefore remains a provider/runtime result, not evidence that the-accepted manual run failed to start. The deterministic browser regression-matrix above supplies exact 0/15/30/60-second acceptance coverage; this live-run proves the selected local model and representative hardware actually-exercise both the roughly-15-second and 30–60-second cold-start classes.+That first-ever cold result records the historical 30-second policy. Current+Ollama and custom OpenAI-compatible preflights use the configured provider+request timeout so a permitted cold local-model load is not misclassified at a+hosted-provider deadline. The deterministic browser regression matrix above+supplies exact 0/15/30/60-second acceptance coverage; this live run proves the+selected local model and representative hardware actually exercise both the+roughly-15-second and 30–60-second cold-start classes.`live-suite` selects every checked-in scenario for the requested track. Theremediation track still requires `--authorize-remediation`; selecting the-track does not broaden mutation authority.+track does not broaden mutation authority. Suite acquisition waits through the+selected route's complete preflight deadline plus bounded cache-publication+grace before restoring a temporary model override. Hosted API routes keep the+short acquisition bound; local subscription, Ollama, and custom+OpenAI-compatible routes keep their longer route-aware bound.An SSH Docker host is allowed only for a manifest-approved shared lab:diff --git a/internal/ai/qualification/client.go b/internal/ai/qualification/client.goindex e8d05ab8df..1f01f9c48c 100644--- a/internal/ai/qualification/client.go+++ b/internal/ai/qualification/client.go@@ -15,11 +15,13 @@ import ("time""github.com/rcourtman/pulse-go-rewrite/internal/ai/providers"+ "github.com/rcourtman/pulse-go-rewrite/internal/config""github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources""github.com/rcourtman/pulse-go-rewrite/pkg/aicontracts")const subscriptionAgentPreflightEvidenceGrace = 15 * time.Second+const localProviderPreflightEvidenceGrace = 15 * time.Secondtype ClientConfig struct {BaseURL string@@ -58,6 +60,8 @@ type AISettings struct {PatrolEnabled bool `json:"patrol_enabled"`CodexSubscriptionEnabled bool `json:"codex_subscription_enabled"`ClaudeSubscriptionEnabled bool `json:"claude_subscription_enabled"`+ OpenAIBaseURL string `json:"openai_base_url"`+ RequestTimeoutSeconds int `json:"request_timeout_seconds"`ZaiBaseURL string `json:"zai_base_url"`PatrolPreflight *PatrolPreflightSnapshot `json:"patrol_preflight,omitempty"`}@@ -125,11 +129,22 @@ func (s AISettings) EffectivePatrolModel() string {return strings.TrimSpace(s.Model)}-func patrolModelSuiteAcquisitionTimeout(provider string, requested time.Duration) time.Duration {- if provider != string(providers.SubscriptionAgentCodex) && provider != string(providers.SubscriptionAgentClaude) {+func patrolModelSuiteAcquisitionTimeout(provider string, requested time.Duration, settings AISettings) time.Duration {+ minimum := time.Duration(0)+ configuredLocalTimeout := (&config.AIConfig{RequestTimeoutSeconds: settings.RequestTimeoutSeconds}).GetRequestTimeout()+ switch provider {+ case string(providers.SubscriptionAgentCodex), string(providers.SubscriptionAgentClaude):+ minimum = providers.SubscriptionAgentMinimumRequestTimeout + subscriptionAgentPreflightEvidenceGrace+ case "ollama":+ minimum = configuredLocalTimeout + localProviderPreflightEvidenceGrace+ case "openai":+ if config.IsCustomOpenAICompatibleEndpoint(settings.OpenAIBaseURL) {+ minimum = configuredLocalTimeout + localProviderPreflightEvidenceGrace+ }+ }+ if minimum <= 0 {return requested}- minimum := providers.SubscriptionAgentMinimumRequestTimeout + subscriptionAgentPreflightEvidenceGraceif requested < minimum {return minimum}@@ -382,7 +397,7 @@ func (c *PulseClient) AcquirePatrolModelSuite(ctx context.Context, model string,if provider == "" || bareModel == "" {return nil, fmt.Errorf("Patrol qualification requires a concrete provider:model route, got %q", target)}- timeout = patrolModelSuiteAcquisitionTimeout(provider, timeout)+ timeout = patrolModelSuiteAcquisitionTimeout(provider, timeout, before)routeChanged := before.EffectivePatrolModel() != target ||(provider == "codex-subscription" && !before.CodexSubscriptionEnabled) ||diff --git a/internal/ai/qualification/client_test.go b/internal/ai/qualification/client_test.goindex a097c15611..2e644e2588 100644--- a/internal/ai/qualification/client_test.go+++ b/internal/ai/qualification/client_test.go@@ -274,19 +274,36 @@ func TestAcquirePatrolModelSuitePinsOneRouteAndUsesFreshAsyncPreflight(t *testinfunc TestPatrolModelSuiteAcquisitionTimeoutIsRouteAware(t *testing.T) {requested := 45 * time.Second- if got := patrolModelSuiteAcquisitionTimeout("openai", requested); got != requested {+ if got := patrolModelSuiteAcquisitionTimeout("openai", requested, AISettings{}); got != requested {t.Fatalf("API route acquisition timeout = %s, want %s", got, requested)}wantSubscription := 2*time.Minute + subscriptionAgentPreflightEvidenceGracefor _, provider := range []string{"codex-subscription", "claude-subscription"} {- if got := patrolModelSuiteAcquisitionTimeout(provider, requested); got != wantSubscription {+ if got := patrolModelSuiteAcquisitionTimeout(provider, requested, AISettings{}); got != wantSubscription {t.Fatalf("%s acquisition timeout = %s, want %s", provider, got, wantSubscription)}}+ wantLocal := 5*time.Minute + localProviderPreflightEvidenceGrace+ localSettings := AISettings{RequestTimeoutSeconds: 300}+ if got := patrolModelSuiteAcquisitionTimeout("ollama", requested, localSettings); got != wantLocal {+ t.Fatalf("Ollama acquisition timeout = %s, want %s", got, wantLocal)+ }+ if got := patrolModelSuiteAcquisitionTimeout("ollama", requested, AISettings{}); got != wantLocal {+ t.Fatalf("default Ollama acquisition timeout = %s, want %s", got, wantLocal)+ }+ customOpenAI := localSettings+ customOpenAI.OpenAIBaseURL = "http://llama.internal:8080/v1"+ if got := patrolModelSuiteAcquisitionTimeout("openai", requested, customOpenAI); got != wantLocal {+ t.Fatalf("custom OpenAI acquisition timeout = %s, want %s", got, wantLocal)+ }longer := 4 * time.Minute- if got := patrolModelSuiteAcquisitionTimeout("claude-subscription", longer); got != longer {+ if got := patrolModelSuiteAcquisitionTimeout("claude-subscription", longer, AISettings{}); got != longer {t.Fatalf("long configured acquisition timeout = %s, want %s", got, longer)}+ longerLocal := 6 * time.Minute+ if got := patrolModelSuiteAcquisitionTimeout("ollama", longerLocal, localSettings); got != longerLocal {+ t.Fatalf("long local acquisition timeout = %s, want %s", got, longerLocal)+ }}func TestAcquirePatrolModelSuitePreflightsConfiguredRouteOnceWithoutSettingsWrite(t *testing.T) {