Skip to content

azure.ai.agents - improve contributor guidance and add AGENTS.md#7111

Open
Copilot wants to merge 8 commits intomainfrom
copilot/improve-error-categorization-guide
Open

azure.ai.agents - improve contributor guidance and add AGENTS.md#7111
Copilot wants to merge 8 commits intomainfrom
copilot/improve-error-categorization-guide

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Summary

This PR improves contributor guidance for the azure.ai.agents extension and makes the tenant selection behavior correct for prompted subscriptions.

  • add an extension-specific AGENTS.md for cli/azd/extensions/azure.ai.agents
  • clarify how to use structured exterrors versus plain Go errors without changing the underlying error model
  • align internal/exterrors package and code comments with the current azd host error serialization behavior
  • document the expected azd core + extension workflow, including when to use a temporary local replace

Why

Recent error categorization work improved telemetry, but it also made it less obvious where structured errors should be created, when plain Go errors are still preferred, and how wrapping interacts with extension error reporting.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 3 commits March 12, 2026 23:51
…functions

- Add Cause field and Unwrap() methods to azdext.LocalError and azdext.ServiceError
  to support Go error chain traversal (errors.Is/errors.As)
- Add XxxWrap() variants to all exterrors factory functions (ValidationWrap,
  DependencyWrap, AuthWrap, etc.) that preserve the cause error
- Update ServiceFromAzure and FromAiService to preserve cause via InternalWrap
- Add comprehensive tests for error chain scenarios
- Add detailed package-level documentation to exterrors explaining when to use
  structured vs plain errors and error chain precedence
- Add replace directive to extension go.mod for local development

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
- Create comprehensive AGENTS.md with extension structure, build/test
  instructions, error handling guidelines, and coding conventions
- Add detailed error handling section to extensions-style-guide.md covering
  structured error types, telemetry classification, the two-layer pattern,
  error chain precedence, and display/UX behavior

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI and others added 3 commits March 13, 2026 00:26
Remove all code changes (Cause field, Unwrap methods, Wrap factory functions,
replace directive, new tests) and keep only documentation improvements:
- AGENTS.md for azure.ai.agents extension
- Error handling section in extensions-style-guide.md
- Doc comments on existing exterrors functions and codes
- Package-level documentation for exterrors

The Cause/Unwrap support will be tracked as a separate GitHub issue.

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
@JeffreyCA JeffreyCA added the ext-agents azure.ai.agents extension label Mar 13, 2026
@JeffreyCA JeffreyCA changed the title Improve extension error handling: add Unwrap/Cause support, Wrap factories, and documentation azure.ai.agents - improve contributor guidance Mar 13, 2026
@JeffreyCA JeffreyCA changed the title azure.ai.agents - improve contributor guidance azure.ai.agents - improve contributor guidance and add AGENTS.md Mar 13, 2026
@JeffreyCA JeffreyCA marked this pull request as ready for review March 13, 2026 17:27
Copilot AI review requested due to automatic review settings March 13, 2026 17:27
@JeffreyCA JeffreyCA force-pushed the copilot/improve-error-categorization-guide branch from 35d3226 to 8e7a35d Compare March 13, 2026 17:31
Copy link
Contributor

Copilot AI left a comment

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 contributor guidance for the azure.ai.agents extension by expanding structured error-handling documentation and adding extension-specific agent instructions.

Changes:

  • Added/expanded documentation describing extension error serialization, telemetry classification, and recommended layering.
  • Added azure.ai.agents-specific AGENTS.md with build workflow and error-handling guidance.
  • Refined internal/exterrors package comments and error-code documentation for clarity.

Reviewed changes

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

File Description
cli/azd/extensions/azure.ai.agents/internal/exterrors/errors.go Adds package-level guidance and section headers clarifying structured error usage and gRPC/Azure conversion helpers.
cli/azd/extensions/azure.ai.agents/internal/exterrors/codes.go Clarifies intent/usage of error-code groups and improves inline documentation.
cli/azd/extensions/azure.ai.agents/AGENTS.md Introduces extension-specific contributor/agent instructions (build, workflow, error handling, conventions).
cli/azd/docs/extensions/extensions-style-guide.md Adds a new section documenting structured extension error types, host serialization behavior, and telemetry classification patterns.

@JeffreyCA JeffreyCA marked this pull request as draft March 13, 2026 17:35
@JeffreyCA JeffreyCA marked this pull request as ready for review March 13, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants