[Agents extension] Detect agent manifest at cwd#7484
Merged
Conversation
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
trangevi
requested review from
JeffreyCA,
hemarina,
rajeshkamal5050,
tg-msft,
therealjohn,
trrwilson,
vhvb1989,
wbreza and
weikanglim
as code owners
April 2, 2026 22:34
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an azd ai agent init enhancement in the azure.ai.agents extension to auto-detect an agent manifest in the working/source directory and optionally use it, improving the “init from existing files” UX.
Changes:
- Auto-detect
agent.manifest.yaml/agent.yamlin the target directory when--manifestis not provided, with a confirmation prompt. - Add
detectLocalManifest+ validation helper to ensure detected files are valid agent manifests. - Add unit tests for local manifest detection; add an overwrite-confirmation when generating
agent.yamlfrom code.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.agents/internal/cmd/init.go | Adds manifest auto-detection and an interactive “use it?” prompt before selecting init flow. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go | Introduces detectLocalManifest + manifest validation helper used by init auto-detection. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers_test.go | Adds tests covering detection behavior and preference/validation rules. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go | Prompts before overwriting an existing agent.yaml when scaffolding from code. |
jongio
reviewed
Apr 3, 2026
jongio
left a comment
Member
There was a problem hiding this comment.
Two features: manifest auto-detection at CWD and overwrite confirmation in init-from-code. Detection logic is solid with content validation and good test coverage (9 cases).
Issues to address:
- init_from_code.go:88 - overwrite check runs after the full interactive setup; declining discards the user's work
- init_from_templates_helpers.go:271 - stat errors other than "not found" silently treated as no manifest
Minor: detectLocalManifest uses exact filename matching while findAgentManifest uses case-insensitive - consider aligning.
Signed-off-by: trangevi <trangevi@microsoft.com>
rajeshkamal5050
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On
init, detect if there's a manifest in the current working directory and ask if the user wants to use that one.