fix: spawnAgent uses ServiceFor instead of global process.Default()
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 <virgil@lethean.io>
This commit is contained in:
parent
537226bd4d
commit
b57be6eb91
1 changed files with 5 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue