Repository navigation
fix(agents): classify non-HTTP Azure client errors and preflight GetAgent attribution - #11000
Draft
Hui Miao (huimiu) wants to merge 2 commits into
Draft
Hui Miao (huimiu) wants to merge 2 commits into
Hui Miao (huimiu) wants to merge 2 commits into
Conversation
|
Azure Pipelines: 27 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Hui Miao (huimiu)
force-pushed
the
hui/agent-deploy-error-classification
branch
from
November 20, 2026 00:07
9218d76 to
4893660
Compare
Hui Miao (huimiu)
force-pushed
the
hui/agent-deploy-error-classification
branch
from
November 23, 2026 00:12
4893660 to
2d04c39
Compare
This branch has not been deployed
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.
Summary
When Azure SDK or Foundry HTTP calls fail without an
*azcore.ResponseErrorinazure.ai.agents,exterrors.ServiceFromAzurefalls back toInternal(operation, ...). That collapses timeouts, local credential failures, DNS/TLS/proxy transport errors, and malformed 2xx payloads into oneinternalbucket without user guidance. Two pre-deployGetAgentpreflight checks inservice_target_agent.goalso passOpCreateAgentinstead ofOpGetAgent, attributing preflight read errors tocreate_agent.This PR fixes preflight
GetAgentattribution, classifies non-ResponseErrorclient failures inServiceFromAzureinto distinct categories and codes with remediation guidance, and redacts URL credentials, query parameters, and fragments from surfaced error messages.Changes
GetAgenterror attribution indeployHostedCodeAgentandreconcileCreateRequestWithDeployedDigitalWorkerTypeto passexterrors.OpGetAgentinstead ofexterrors.OpCreateAgentResponseErrorfailures inexterrors.ServiceFromAzure:context.DeadlineExceeded, gRPCDeadlineExceeded, andnet.Error.Timeout()map toInternal(CodeDeadlineExceeded, ...)(deadline_exceeded, which unwraps tocontext.DeadlineExceeded->ResultCode="internal.timeout"on the host)*azidentity.AuthenticationFailedError,*azidentity.AuthenticationRequiredError, andAzureDeveloperCLICredential/DefaultAzureCredentialfailures map toAuth(CodeAuthFailed | CodeCredentialCreationFailed, ...)*ResponseReadError,NewResponseReadClassificationPolicy,WrapPipelineError, andazcorebodyDownloadPolicyerrors) map toInternal(operation + "_response_read", ...)*ResponseParseError) map toInternal(operation + "_response_parse", ...)*net.OpError, non-timeoutnet.Error, and*url.Errortransport failures map toDependency(operation + "_transport", ...)with network/DNS/TLS troubleshooting guidanceRedactURLandsafeErrorMessageininternal/exterrorsso URL userinfo, query parameters, fragments, and malformed URLs are redacted before formatting error messagesNewResponseReadClassificationPolicyto Azure/Foundry client pipelines and wrap post-2xx response read and JSON decode failures withWrapPipelineError,WrapResponseRead, andWrapResponseParseacrossagent_apiandinternal/pkg/azureStateStoreWriteOutcomeUnknownErrorwhenServiceFromAzureclassifies a mid-flight transport drop asDependencyinternal/exterrors/errors_test.go,internal/pkg/agents/agent_api/operations_test.go, andinternal/project/hosted_agent_errors_test.go, updateinternal/project/prompt_headers_test.go, and updatecli/azd/extensions/azure.ai.agents/AGENTS.mdUser-facing changes
When an
azdagent command orazd deploy/azd upfails due to local authentication or client-side network/DNS/TLS transport issues before receiving an HTTP response from Foundry or Azure, the error now includes a remediation suggestion (such as runningazd auth loginor checking network, VPN, Private Endpoint DNS, TLS proxy, or firewall settings), and embedded URL credentials, query parameters, and fragments are redacted.Telemetry change
What changed: Refines span status
ResultCode(StatusDescription) and existing error attributes emitted on command (cmd.*) and extension (ext.run) spans whenexterrors.ServiceFromAzurehandles failures inazure.ai.agents. No new events, spans,ReportUsagecalls, or telemetry fields are added.GetAgentServiceErrorfailures in hosted code and container deploy paths now emiterror.service.name="get_agent"instead of"create_agent"(alongside existingerror.service.statusCode,error.service.errorCode, anderror.service.host), and spanResultCodechanges fromext.service.create_agent.<code>toext.service.get_agent.<code>(for example,ext.service.get_agent.403).ResponseErrorLocalErrorfailures previously emittedResultCode="ext.internal.<operation>",error.category="internal", and unprefixederror.code="<operation>"(for example,error.code="create_agent"). They now emit bounded, code-defined values:deadline_exceeded):ResultCode="internal.timeout"viacontext.DeadlineExceededunwrap (noerror.category/error.codeattributes)ResultCode="ext.auth.auth_failed"or"ext.auth.credential_creation_failed",error.category="auth",error.code="auth_failed"or"credential_creation_failed"ResultCode="ext.dependency.<operation>_transport",error.category="dependency",error.code="<operation>_transport"ResultCode="ext.internal.<operation>_response_read",error.category="internal",error.code="<operation>_response_read"ResultCode="ext.internal.<operation>_response_parse",error.category="internal",error.code="<operation>_response_parse"ResultCode="ext.internal.<operation>",error.category="internal",error.code="<operation>"Why it is needed: Separate genuine extension/SDK response-handling bugs and service timeouts from client-side auth, DNS, proxy, and TLS failures in agent deployment reliability metrics without losing visibility into post-2xx failures.
Approval coverage (maintainer): pending assessment
ResultCode,error.code,error.category, anderror.service.namevalues come strictly from fixed code constants (Op*+ fixed suffixes); customer inputs, URLs, and raw error messages are never placed in telemetry codes.error.code,error.category, anderror.service.*declarations (SystemMetadata/PerformanceAndHealth) indocs/specs/metrics-audit/telemetry-schema.mdare unchanged; extension error-handling guidance incli/azd/extensions/azure.ai.agents/AGENTS.mdis updated.ResultCode(ext.internal.create_agent,ext.dependency.*_transport) and unprefixederror.code(create_agent,*_transport) will be updated after release (@huimiu).@huimiu); no telemetry schema/metadata deployment is needed because no fields or events were added; downstream BI query updates are owned by@huimiupost-release.Open questions or follow-ups: Maintainer approval-coverage assessment before merge;
@huimiuto monitor splitext.dependency.*_transport,ext.auth.*,internal.timeout, andext.internal.*_response_*codes after the nextazure.ai.agentsrelease.Notes
Impacted
cli-interactive-testerscenario tags (not auto-run):deploy,verify-deploy,cmd:up,cmd:deploy,state-stores.