Azure / Azure/azure-dev

Init doesn't leave a failed attempt with a non-empty directory

Open
#8,248 0 comments 0 reactions 0 assignees View on GitHub
area/templates bug ext-agents
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

Init can fail which leaves the template files (code, infra, etc.) in the directory, which means you cant easily do another init to recover.

- azd ai agent init creates the target dir and (for container agents) copies/downloads source files in downloadAgentYaml before running the model/deploy/parameter prompts.
- When a later prompt fails, the dir is left non-empty -> a re-run hits resolveCollisions and either prompts to rename or (no-prompt) silently renames to a -2 suffix.

Defer any files until all the info is collected using a stage and commit pattern, similar to azd init.

This can happen when a coding agent tries to --no-prompt, but then doesnt have the subscription info set, so then it will set it and try to `init` again, but the directory has old files in it.

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.