replace toolsrv.Decl with inline closure over New()

This commit is contained in:
Levi Neely 2026-07-29 23:23:51 +02:00
parent 279dc2a504
commit b2462c6a06
2 changed files with 14 additions and 2 deletions

View File

@ -152,7 +152,13 @@ func (s *Manager) CreateSession(args []string) (string, error) {
"PRIME_IS_GIT_REPO=" + fmt.Sprintf("%v", rsrv.Info.IsGitRepo),
}
} else {
newToolServer = toolsrv.Decl(cwd, execOpts...)
newToolServer = func() toolsrv.Runner {
srv := toolsrv.New(cwd)
for _, o := range execOpts {
o(srv)
}
return srv
}
}
var promptEnv []string

View File

@ -167,7 +167,13 @@ func (s *Manager) restoreSession(ps *agent.PersistedAgent) error {
execOpts = append(execOpts, toolsrv.WithSkillsRegistry(s.cfg.SkillsRegistry))
execOpts = append(execOpts, toolsrv.WithBuiltins(tools.Builtins()))
}
newToolServer = toolsrv.Decl(cwd, execOpts...)
newToolServer = func() toolsrv.Runner {
srv := toolsrv.New(cwd)
for _, o := range execOpts {
o(srv)
}
return srv
}
promptEnv = agent.PromptEnv(cwd)
}