Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

fix(ai): support quickstart explore prepass

rcourtman2617bb795b3d
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 4158a90375..e62cb53a8b 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -88,6 +88,12 @@ may exist only as an explicit environment-controlled rollout escape hatch, and
the canonical quickstart proxy contract remains an OpenAI-compatible server-owned
surface that lives behind the public license API rather than a tenant-local or
mobile-local adapter.
+That same provider-model contract applies to the chat explore pre-pass in
+`internal/ai/chat/service_explore.go`: any runtime model that is valid for the
+main chat execution path, including `quickstart:minimax-2.5m`, must resolve
+through the dedicated explore provider path as well. Explore must not reject
+the canonical quickstart provider while the main chat loop accepts it, because
+hosted tenants rely on the same governed quickstart model before BYOK exists.
The same runtime ownership now includes the customer-facing AI usage and cost
surface. `frontend-modern/src/components/AI/AICostDashboard.tsx` is the
diff --git a/internal/ai/chat/service_explore.go b/internal/ai/chat/service_explore.go
index 07f3447912..1c098d194f 100644
--- a/internal/ai/chat/service_explore.go
+++ b/internal/ai/chat/service_explore.go
@@ -251,6 +251,10 @@ func (s *Service) createProviderForExplore(modelStr string) (providers.Streaming
baseURL = "http://localhost:11434"
}
return providers.NewOllamaClient(modelName, baseURL, exploreHTTPTimeout), nil
+ case config.AIProviderQuickstart:
+ // Quickstart uses the hosted proxy and does not require a BYOK key.
+ // The orgID carries the hosted workspace identity for credit accounting.
+ return providers.NewQuickstartClient(s.orgID), nil
default:
return nil, fmt.Errorf("unsupported provider: %s", providerName)
}
diff --git a/internal/ai/chat/service_explore_test.go b/internal/ai/chat/service_explore_test.go
index 455c28e6cd..17009600ec 100644
--- a/internal/ai/chat/service_explore_test.go
+++ b/internal/ai/chat/service_explore_test.go
@@ -360,6 +360,29 @@ func TestResolveExploreProvider_FallsBackToNextExplicitModel(t *testing.T) {
}
}
+func TestResolveExploreProvider_SupportsQuickstartModel(t *testing.T) {
+ svc := NewService(Config{
+ AIConfig: &config.AIConfig{
+ Enabled: true,
+ DiscoveryModel: config.AIProviderQuickstart + ":" + config.DefaultAIModelQuickstart,
+ },
+ StateProvider: &mockStateProvider{},
+ AgentServer: &mockAgentServer{},
+ })
+ svc.orgID = "t-hosted"
+
+ provider, model := svc.resolveExploreProvider("", "", nil)
+ if provider == nil {
+ t.Fatal("expected explore provider resolution to succeed for quickstart")
+ }
+ if model != "quickstart:minimax-2.5m" {
+ t.Fatalf("expected quickstart explore model, got %q", model)
+ }
+ if provider.Name() != config.AIProviderQuickstart {
+ t.Fatalf("expected quickstart provider, got %q", provider.Name())
+ }
+}
+
func TestService_ExecuteStream_ExplorePrepassFailureStillRunsMain(t *testing.T) {
t.Setenv(exploreEnabledEnvVar, "true")