Skip to content

[Agents extension] Detect agent manifest at cwd#7484

Merged
rajeshkamal5050 merged 3 commits into
mainfrom
trangevi/cwd-manifest
Apr 3, 2026
Merged

[Agents extension] Detect agent manifest at cwd#7484
rajeshkamal5050 merged 3 commits into
mainfrom
trangevi/cwd-manifest

Conversation

@trangevi

@trangevi trangevi commented Apr 2, 2026

Copy link
Copy Markdown
Member

On init, detect if there's a manifest in the current working directory and ask if the user wants to use that one.

trangevi added 2 commits April 2, 2026 15:24
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yaml in the target directory when --manifest is 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.yaml from 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.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_templates_helpers.go Outdated

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go Outdated
Signed-off-by: trangevi <trangevi@microsoft.com>
@rajeshkamal5050
rajeshkamal5050 merged commit 6ac724d into main Apr 3, 2026
17 checks passed
@trangevi
trangevi deleted the trangevi/cwd-manifest branch April 3, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants