From a31cea36a6a626f74a017b49e632c6a2726f776c Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 24 Mar 2026 21:33:00 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20use=20c.Run()=20=E2=80=94=20main.go=20d?= =?UTF-8?q?own=20to=20120=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Virgil --- cmd/core-agent/main.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/cmd/core-agent/main.go b/cmd/core-agent/main.go index c72c9ca..8d28125 100644 --- a/cmd/core-agent/main.go +++ b/cmd/core-agent/main.go @@ -1,10 +1,7 @@ package main import ( - "context" "os" - "os/signal" - "syscall" "dappco.re/go/core" "dappco.re/go/core/process" @@ -16,10 +13,6 @@ import ( ) func main() { - // Signal-aware context for clean shutdown - ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) - defer cancel() - r := core.New( core.WithOption("name", "core-agent"), core.WithService(func(c *core.Core) core.Result { @@ -116,17 +109,12 @@ func main() { registerWorkspaceCommands(c) // registerFlowCommands(c) — on feat/flow-system branch - // Start all services — registers service commands, starts runners, wires IPC - c.ServiceStartup(ctx, nil) - - // Run CLI - result := c.Cli().Run() - if !result.OK { - if err, ok := result.Value.(error); ok { + // Run: ServiceStartup → Cli → ServiceShutdown + r = c.Run() + if !r.OK { + if err, ok := r.Value.(error); ok { core.Error(err.Error()) } os.Exit(1) } - - c.ServiceShutdown(ctx) }