From b57be6eb91d1c2336a6e7c36facbe9f124e9b038 Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 26 Mar 2026 06:47:44 +0000 Subject: [PATCH] fix: spawnAgent uses ServiceFor instead of global process.Default() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The global process.StartWithOptions() requires process.SetDefault() which was never called. Use core.ServiceFor[*process.Service] to get the registered service instance directly — same code path, proper Core wiring. Fixes: dispatch failing with "failed to spawn codex" on CLI dispatch. Co-Authored-By: Virgil --- pkg/agentic/dispatch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/agentic/dispatch.go b/pkg/agentic/dispatch.go index 89ef792..8666d2b 100644 --- a/pkg/agentic/dispatch.go +++ b/pkg/agentic/dispatch.go @@ -362,7 +362,11 @@ func (s *PrepSubsystem) spawnAgent(agent, prompt, wsDir string) (int, string, er agentBase := core.SplitN(agent, ":", 2)[0] command, args = containerCommand(agentBase, command, args, repoDir, metaDir) - sr := process.StartWithOptions(context.Background(), process.RunOptions{ + procSvc, ok := core.ServiceFor[*process.Service](s.Core(), "process") + if !ok { + return 0, "", core.E("dispatch.spawnAgent", "process service not registered", nil) + } + sr := procSvc.StartWithOptions(context.Background(), process.RunOptions{ Command: command, Args: args, Dir: repoDir,