Azure / Azure/azure-dev

`azd ai agent init` is overloaded and makes it difficult to debug at times

Open
#8,383 0 comments 0 reactions 1 assignee Claimed by @hund030 View on GitHub
area/ux enhancement ext-agents needs-discussion
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

Another issue we are repeatedly facing is difficulty debuging the azd ai agent init command when it goes sideways. This is because this command is overloaded and the behavior of the command is contextual and not declarative. The agent init command does a couple of different things depending on the context under which it was executed.

- **Clean Environment -** running azd ai agent init in this context and choosing the option to start from template will scaffold the project and create an agent.
- **Parent directory contains azure.yaml** - running azd ai agent init and choosing start from template where an ancestor directory has an azure.yaml, means that it will use the context of that azure.yaml and add an agent from the template.
- **Existing agent code** - running azd ai agent init in this context and choosing the option to use existing code will scaffold the project and create an agent.
- **Parent directory contains azure.yaml and existing agent code not in yaml's** - Haven't tried this yet, not sure what happens

TLDR: the azd ai agent init command is at least two commands. First, it is a scaffolding command that sets up all of the hosted agent plumbing. Second, it is a create agent command where you are creating an agent from a template.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.