Skip to content
Merged
Prev Previous commit
Next Next commit
PR Comments
Signed-off-by: trangevi <[email protected]>
  • Loading branch information
trangevi committed Oct 27, 2025
commit 0e6aea23635bfca0b87eaab91a33d4daba73e662
13 changes: 8 additions & 5 deletions cli/azd/extensions/azure.foundry.ai.agents/internal/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,13 @@ func (a *InitAction) downloadAgentYaml(
}

if isGitHubUrl {
// Check if the template is a HostedContainerAgent
if _, isHostedContainer := agentManifest.Template.(agent_yaml.HostedContainerAgent); isHostedContainer {
// For hosted agents, download the entire parent directory
fmt.Println("Downloading full directory for hosted agent")
// Check if the template is a HostedContainerAgent or ContainerAgent
_, isHostedContainer := agentManifest.Template.(agent_yaml.HostedContainerAgent)
_, isContainerAgent := agentManifest.Template.(agent_yaml.ContainerAgent)

if isHostedContainer || isContainerAgent {
// For container agents, download the entire parent directory
fmt.Println("Downloading full directory for container agent")
err := downloadParentDirectory(ctx, urlInfo, targetDir, ghCli, console)
if err != nil {
return nil, "", fmt.Errorf("downloading parent directory: %w", err)
Expand Down Expand Up @@ -771,7 +774,7 @@ func (a *InitAction) addToProject(ctx context.Context, targetDir string, agentMa
}

serviceConfig := &azdext.ServiceConfig{
Name: agentDef.Name,
Name: strings.ReplaceAll(agentDef.Name, " ", ""),
RelativePath: targetDir,
Host: host,
Language: "python",
Expand Down
Loading