add troubleshooting scope selection#6902
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates agent-mode error handling to reduce overly verbose troubleshooting output by prompting users to choose the troubleshooting “scope” (explain / guide / summarize / skip) and by adding LLM playbook guidance for a common Azure provisioning capacity/SKU error.
Changes:
- Added a combined consent + troubleshooting-scope selector (
promptTroubleshootingWithConsent) with “always” preferences persisted in user config. - Refactored
ErrorMiddleware.Runto generate different troubleshooting prompts based on the selected scope (concise explanation vs fix steps vs summary). - Extended
azd_provision_common_error.mdwith a new pattern/instructions for regional SKU capacity shortages.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cli/azd/cmd/middleware/error.go | Introduces troubleshooting scope selection, updates consent messaging, and adjusts agent prompts accordingly. |
| cli/azd/internal/mcp/tools/prompts/azd_provision_common_error.md | Adds specialized LLM instructions for a “region SKU capacity unavailable” provisioning error. |
Comments suppressed due to low confidence (1)
cli/azd/cmd/middleware/error.go:422
- The doc comment for
promptTroubleshootingWithConsentis out of sync with the actual supported scopes. The implementation returns "explain"/"guide"/"summarize" (or ""), but the comment mentions ("explain", "fix", "summary"). Please update the comment to match the real values so callers and future refactors don’t rely on incorrect documentation.
}
if choiceIndex == nil || *choiceIndex < 0 || *choiceIndex >= len(choices) {
return "", fmt.Errorf("invalid choice selected")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
fix #6834
This pull request introduces improvements to the error handling middleware in
cli/azd/cmd/middleware/error.go, focusing on enhancing user consent prompts and troubleshooting flows. The changes streamline troubleshooting scope selection, clarify consent messaging, and add specialized LLM instructions for a common Azure provisioning error. The most important changes are grouped below by theme.Troubleshooting workflow improvements:
promptTroubleshootingWithConsentmethod to combine user consent and troubleshooting scope selection into a single prompt, supporting "explain", "guide", "summarize", and "skip" options, as well as "always" preferences that persist across sessions.Runto use the new troubleshooting scope, generating tailored prompts for explanation, guidance, or summary based on user selection. [1] [2]