Summary
After the Copilot SDK is implemented, we need to revisit the error categorization in classifyError() (cmd/middleware/error.go) for UserContextError and MachineContextError.
Currently, errors classified under these two categories are not sent for full agentic analysis and automated fix (only AzureContextAndOtherError is eligible). However, some of these errors are actually fixable by the agent and should be reconsidered once the Copilot SDK provides richer capabilities.
Details
UserContextError (potentially fixable)
Some user-context errors that could be auto-remediated:
auth.ReLoginRequiredError / auth.AuthFailedError — agent could guide or trigger re-authentication
auth.ErrNoCurrentUser / azapi.ErrAzCliNotLoggedIn / azapi.ErrAzCliRefreshTokenExpired — agent could prompt login flow
environment.ErrNotFound / environment.ErrNameNotSpecified / environment.ErrDefaultEnvironmentNotFound — agent could help create or select an environment
pipeline.ErrAuthNotSupported / pipeline.ErrRemoteHostIsNotAzDo / pipeline.ErrRemoteHostIsNotGitHub — agent could suggest configuration changes
MachineContextError (potentially fixable)
Some machine-context errors that could be auto-remediated:
tools.MissingToolErrors — agent could suggest or run install commands
tools.ErrSemver (version mismatch) — agent could suggest upgrade commands
maven.ErrPropertyNotFound — agent could help fix Maven configuration
Action Items
Context
- Error classification:
cli/azd/cmd/middleware/error.go (lines 55-116)
- Tests:
cli/azd/cmd/middleware/error_test.go
- The three categories today:
AzureContextAndOtherError (agentic fix), MachineContextError (local env), UserContextError (user config/auth)
Summary
After the Copilot SDK is implemented, we need to revisit the error categorization in
classifyError()(cmd/middleware/error.go) forUserContextErrorandMachineContextError.Currently, errors classified under these two categories are not sent for full agentic analysis and automated fix (only
AzureContextAndOtherErroris eligible). However, some of these errors are actually fixable by the agent and should be reconsidered once the Copilot SDK provides richer capabilities.Details
UserContextError (potentially fixable)
Some user-context errors that could be auto-remediated:
auth.ReLoginRequiredError/auth.AuthFailedError— agent could guide or trigger re-authenticationauth.ErrNoCurrentUser/azapi.ErrAzCliNotLoggedIn/azapi.ErrAzCliRefreshTokenExpired— agent could prompt login flowenvironment.ErrNotFound/environment.ErrNameNotSpecified/environment.ErrDefaultEnvironmentNotFound— agent could help create or select an environmentpipeline.ErrAuthNotSupported/pipeline.ErrRemoteHostIsNotAzDo/pipeline.ErrRemoteHostIsNotGitHub— agent could suggest configuration changesMachineContextError (potentially fixable)
Some machine-context errors that could be auto-remediated:
tools.MissingToolErrors— agent could suggest or run install commandstools.ErrSemver(version mismatch) — agent could suggest upgrade commandsmaven.ErrPropertyNotFound— agent could help fix Maven configurationAction Items
UserContextErrorandMachineContextErrorcategoriesFixablevsNonFixable) or promote fixable errors toAzureContextAndOtherErrorclassifyError()logic and corresponding tests inerror_test.goContext
cli/azd/cmd/middleware/error.go(lines 55-116)cli/azd/cmd/middleware/error_test.goAzureContextAndOtherError(agentic fix),MachineContextError(local env),UserContextError(user config/auth)