Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Copilot-driven error handling to let users choose a troubleshooting “category” (explain/guidance/troubleshoot/skip) before optionally letting the agent apply a fix.
Changes:
- Adds
copilot.errorHandling.categoryconfig key and category selection prompt. - Splits the previous troubleshooting prompt into new embedded templates (
explain,guidance,fix) and routes prompts based on category. - Updates middleware flow and adds tests for category constants and prompt rendering.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/internal/agent/copilot/config_keys.go | Adds the new copilot.errorHandling.category config key constant. |
| cli/azd/cmd/middleware/templates/guidance.tmpl | New prompt template for providing manual fix steps. |
| cli/azd/cmd/middleware/templates/fix.tmpl | New prompt template for agent-applied fixes. |
| cli/azd/cmd/middleware/templates/explain.tmpl | New prompt template for explanation-only responses. |
| cli/azd/cmd/middleware/error_test.go | Adds tests for new category constants and prompt-building helpers. |
| cli/azd/cmd/middleware/error.go | Implements category selection + new multi-step agent flow; embeds new templates. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
- Add Unreleased section to CHANGELOG covering merged PRs from 2026-03-19/20: - feat: AI-assisted error troubleshooting category selection (Azure#7216) - feat: CopilotService gRPC extension framework service (Azure#7172) - fix: lifecycle hooks silently not firing in azd up workflow (Azure#7218) - fix: azd update for Linux/macOS shell script and Homebrew (Azure#7213) - fix: azd update on Windows with backup/restore safety (Azure#7166) - fix: azd up --debug/--no-prompt positional arg error (Azure#7212) - fix: PromptSubscription not respecting AZD_DEMO_MODE (Azure#7193) - fix: preflight role check for B2B/guest users (Azure#7174) - Add AZD_DEMO_MODE note to PromptSubscription in extension-framework.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add AI-Powered Error Troubleshooting section to error-suggestions.md documenting the new category-based flow (explain/guidance/troubleshoot/skip), the three-step interactive process, and configuration keys introduced in Azure#7216 - Update design/azd-update.md to reflect Homebrew cask support, install script updates for macOS/Linux, and MSI backup/restore improvements from Azure#7213 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add category and fix on error handling * Update cli/azd/cmd/middleware/templates/guidance.tmpl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add error message * go fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix #7215
This pull request significantly refactors the error troubleshooting workflow in the
ErrorMiddlewareto provide a more flexible and user-friendly experience. Instead of a single consent prompt, users can now choose the troubleshooting scope (explanation, fix guidance, full troubleshooting, or skip), with improved configuration options and clearer prompts. The code introduces new templates, configuration keys, and supporting logic, along with comprehensive tests for the new behavior.Key changes include:
User Experience and Workflow Improvements:
Prompt and Template Enhancements:
explain.tmpl,guidance.tmpl, andfix.tmpl, each with specific instructions for the agent, and updates the logic to render the appropriate template based on user selection. [1] [2] [3] [4] [5]Configuration and Codebase Updates:
ConfigKeyErrorHandlingCategoryto manage the default troubleshooting scope in user config, and removes the obsoleteConfigKeyErrorHandlingTroubleshootSkipkey.Testing:
These changes make the troubleshooting experience more customizable, transparent, and robust for users.
User Experience and Workflow:
Prompt and Template System:
explain.tmpl,guidance.tmpl,fix.tmpl) for each troubleshooting category, and updates logic to select and render the correct template. [1] [2] [3] [4] [5]Configuration and Codebase Refactoring:
ConfigKeyErrorHandlingCategoryfor category preference; removes obsolete troubleshooting skip key; updates related logic and data structures. [1] [2]Testing Enhancements: