From 9a0d748849a04741e3b61ca24237d803da1a5c1e Mon Sep 17 00:00:00 2001 From: Christopher Petito Date: Thu, 20 Nov 2025 12:10:04 +0100 Subject: [PATCH] fix loading teams from a dir in api command Signed-off-by: Christopher Petito --- cmd/root/api.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/root/api.go b/cmd/root/api.go index a5675c3b1..ddb4b3498 100644 --- a/cmd/root/api.go +++ b/cmd/root/api.go @@ -86,17 +86,15 @@ func (f *apiFlags) runAPICommand(cmd *cobra.Command, args []string) error { var opts []server.Opt if !agentfile.IsOCIReference(agentsPath) { - // Local files/dirs: set agentsPath for single-file reload, agentsDir for write ops - opts = append(opts, server.WithAgentsPath(agentsPath)) - stat, err := os.Stat(resolvedPath) if err != nil { return fmt.Errorf("failed to stat agents path: %w", err) } if stat.IsDir() { + // For directories: only set agentsDir, not agentsPath opts = append(opts, server.WithAgentsDir(resolvedPath)) } else { - opts = append(opts, server.WithAgentsDir(filepath.Dir(resolvedPath))) + opts = append(opts, server.WithAgentsPath(resolvedPath), server.WithAgentsDir(filepath.Dir(resolvedPath))) } }