Skip to content

fix(azure.ai.agents): preserve hosted agent deployment error classification - #9491

Open
Hui Miao (huimiu) wants to merge 2 commits into
mainfrom
fix/azure-ai-agents-error-classification
Open

fix(azure.ai.agents): preserve hosted agent deployment error classification#9491
Hui Miao (huimiu) wants to merge 2 commits into
mainfrom
fix/azure-ai-agents-error-classification

Conversation

@huimiu

@huimiu Hui Miao (huimiu) commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Preserve structured Azure service errors during hosted agent create, update, and deployment polling.
  • Classify hosted deployment ImageError, CodeError, and ProvisioningError with stable operation-specific service codes and remediation guidance.
  • Preserve actionable host errors and classify container build/package/publish failures through the extension-side error helper when metadata is available.
  • Add regression coverage for Azure response errors, host errors, and async deployment failures.

Scope

This PR intentionally contains only the azure.ai.agents extension changes. The separate azd core gRPC ServiceErrorDetail transport change is not included. Without that core change, ordinary container service errors returned over host gRPC may still lack service status/code metadata; auth, actionable, and extension-local classification improvements remain covered here.

E2E Test Results

Command Result Outcome
azd package agent --no-prompt PASS Final hosted-agent source packaged successfully.
azd deploy agent --no-prompt PASS Hosted code agent reached active status.
azd up --no-prompt PASS Parent provision/package/deploy lifecycle completed successfully.

During setup, Foundry returned a CodeError for a missing Python dependency manifest. The CLI preserved the provider classification and remediation guidance; after correcting the fixture, the same deploy command reached active status.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Preserves structured error classification across hosted-agent deployment and container host operations.

Changes:

  • Adds Azure and host gRPC error converters.
  • Classifies deployment polling failures with remediation guidance.
  • Adds regression tests and extension guidance.

Reviewed changes

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

Show a summary per file
File Description
internal/project/service_target_agent.go Applies structured errors to package, publish, and deploy flows.
internal/project/service_target_agent_test.go Tests deployment and host service classification.
internal/exterrors/errors.go Adds structured error conversion helpers.
internal/exterrors/errors_test.go Tests Azure and gRPC error preservation.
AGENTS.md Documents the host error helper.

Comment thread cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go Outdated
Copilot AI review requested due to automatic review settings August 7, 2026 05:09
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

cli/azd/extensions/azure.ai.agents/internal/exterrors/errors.go:168

  • [azd-code-reviewer] This check runs too late for authentication failures whose inner cause is an azcore.ResponseError. AuthenticationFailedError implements Unwrap, so the response-error branch above matches first and returns a service error, losing the auth category and login guidance. Check AuthenticationFailedError before ResponseError, and add a regression test using azidentity.NewAuthenticationFailedError around a response error.
	if _, ok := errors.AsType[*azidentity.AuthenticationFailedError](err); ok {
		return Auth(CodeAuthFailed, err.Error(), "run `azd auth login` to authenticate")

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.

Preserve hosted agent deployment error classification

2 participants