Skip to content

[Agents Extension] Update invalid manifest error message#7765

Merged
trangevi merged 2 commits into
mainfrom
trangevi/better-marshal-error
Apr 17, 2026
Merged

[Agents Extension] Update invalid manifest error message#7765
trangevi merged 2 commits into
mainfrom
trangevi/better-marshal-error

Conversation

@trangevi

Copy link
Copy Markdown
Member

Provides additional guidance to check for a "template" field

Fixes #7686

… yaml.

Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi marked this pull request as ready for review April 16, 2026 22:08
Copilot AI review requested due to automatic review settings April 16, 2026 22:08
@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated

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

This PR improves the Azure AI Agents extension’s UX when agent.yaml fails to parse/validate as an AgentManifest, returning a structured validation LocalError that includes a helpful suggestion (notably: check for a template field), addressing #7686.

Changes:

  • Return a structured azdext.LocalError (validation) when YAML unmarshal into AgentManifest fails, including a suggestion to check for template.
  • Add a unit test asserting the error is a validation LocalError with the expected code/category and a non-empty suggestion.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Converts unmarshal failures into a structured validation error with code and suggestion.
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse_test.go Adds test coverage validating the structured error shape (code/category/message/suggestion).

Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse_test.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse_test.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse_test.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.

LGTM. The structured error with the template-field hint is a good UX improvement for the #7686 scenario.

One note: the Copilot bot's import ordering suggestion is incorrect - the PR's current ordering (stdlib, then local azureaiagent/..., then external github.com/...) matches the existing convention in map.go in this same package. I'd ignore that suggestion.

Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi merged commit bee23c6 into main Apr 17, 2026
19 checks passed
github-actions Bot added a commit to weikanglim/azure-dev that referenced this pull request Apr 17, 2026
- Add .azdxignore support docs for azd x watch (PR Azure#7697)
- Document reserved resource names preflight check (PR Azure#7746)
- Add CHANGELOG entries for AI extension flag changes (PR Azure#7741)
- Add CHANGELOG entries for Agents Extension RBAC fixes (PRs Azure#7763, Azure#7747, Azure#7765)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: downloading agent.yaml: YAML content does not conform to AgentManifest format: yaml: unmarshal errors

4 participants