Skip to content

Commit cff375a

Browse files
committed
Add error for unsupported agent files
Signed-off-by: David Gageot <david.gageot@docker.com>
1 parent 94cb760 commit cff375a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

pkg/oci/build.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ func BuildDockerImage(ctx context.Context, agentFilePath, dockerImageName string
3131
return err
3232
}
3333

34+
// Make sure the config is compatible with `cagent build`
35+
for _, agent := range cfg.Agents {
36+
for i := range agent.Toolsets {
37+
toolSet := agent.Toolsets[i]
38+
39+
if toolSet.Type == "mcp" && toolSet.Command != "" {
40+
return fmt.Errorf("toolset with command \"%s\" can't be used in `cagent build`", toolSet.Command)
41+
}
42+
}
43+
}
44+
3445
// Analyze the config to find which secrets are needed
3546
modelNames := config.GatherModelNames(cfg)
3647
mcpServers := config.GatherMCPServerReferences(cfg)

0 commit comments

Comments
 (0)