From 86677c1c53d723823dd7093083827abd2bf03008 Mon Sep 17 00:00:00 2001 From: Nicholas Bucher Date: Thu, 27 Aug 2026 22:45:57 -0400 Subject: [PATCH] fix: wire the system service into controller-v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inventory wiring lived in the legacy controller application, deleted by #2595, and controller-v2 never carried it over. `grpcserver.New` then falls back to a system service constructed with no options, so it holds no Kubernetes client and every namespace read returns an internal error. The UI reads templates one namespace at a time, so the namespace list is an input to that read rather than a detail beside it: the agents page reports the failure as "Could not load agents — internal server error" and lists nothing. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Nicholas Bucher --- go/core/cmd/controller-v2/main.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/go/core/cmd/controller-v2/main.go b/go/core/cmd/controller-v2/main.go index 4d1080c82..476651274 100644 --- a/go/core/cmd/controller-v2/main.go +++ b/go/core/cmd/controller-v2/main.go @@ -33,6 +33,7 @@ import ( "github.com/kagent-dev/kagent/go/core/internal/grpcserver" authimpl "github.com/kagent-dev/kagent/go/core/internal/httpserver/auth" "github.com/kagent-dev/kagent/go/core/internal/service/kubecrud" + systemservice "github.com/kagent-dev/kagent/go/core/internal/service/system" "github.com/kagent-dev/kagent/go/core/pkg/auth" "github.com/kagent-dev/kagent/go/core/pkg/migrations" "github.com/kagent-dev/kagent/go/core/v2/a2agateway" @@ -142,8 +143,17 @@ func main() { // the only way to author a Harness or an AgentTemplate is kubectl. AgentTemplateService: kubecrud.NewService(manager.GetClient(), authorizer, &kagentv1alpha3.AgentTemplate{}, &kagentv1alpha3.AgentTemplateList{}, "AgentTemplate"), HarnessService: kubecrud.NewService(manager.GetClient(), authorizer, &kagentv1alpha3.Harness{}, &kagentv1alpha3.HarnessList{}, "Harness"), - CheckpointService: checkpoints, - A2AHandler: gateway, + // Namespaces and the substrate inventory. Without the inventory the system + // service holds no Kubernetes client, so every namespace read fails as an + // internal error — which the agents list reports as a page that cannot load. + SystemService: systemservice.NewService(systemservice.WithInventory( + manager.GetClient(), + namespaces(os.Getenv("WATCH_NAMESPACES")), + authorizer, + actors, + )), + CheckpointService: checkpoints, + A2AHandler: gateway, }) if err != nil { log.Fatal(err)