-
Notifications
You must be signed in to change notification settings - Fork 267
Debug prompt fixes/improvements #6537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…inuing ExtensionHost.Run() is an exception where we instead continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the debugger prompt experience by fixing exit behavior when users decline or cancel debug prompts via AZD_DEBUG and AZD_EXT_DEBUG environment variables, and adds a mutex lock to prevent concurrent prompt access in the gRPC prompt service.
Changes:
- Modified
AZD_DEBUGmiddleware to exit immediately when user declines or presses Ctrl+C instead of looping - Updated
AZD_EXT_DEBUGbehavior to continue normally when user declines or cancels, preventing extension process from exiting while azd continues - Added prompt lock mechanism to prevent concurrent prompt access in gRPC extension prompt service
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| cli/azd/cmd/middleware/debug.go | Removed infinite loop, added proper handling for user decline and Ctrl+C cancellation |
| cli/azd/pkg/azdext/debugger.go | Changed return type to error, added ErrDebuggerAborted sentinel error, improved error handling for cancellation |
| cli/azd/pkg/azdext/extension_host.go | Ignored WaitForDebugger return value to continue execution regardless of debug prompt response |
| cli/azd/internal/grpcserver/prompt_service.go | Added promptLock mechanism and acquirePromptLock calls to all prompt methods to prevent concurrent access |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #6538
This PR improves the debugger prompt experience when the
AZD_DEBUGorAZD_EXT_DEBUGenv var is set.AZD_DEBUG- when user answers No or inputsCtrl+C, azd exits immediately instead of re-prompting in a loop.AZD_EXT_DEBUG- when the user runs core commands likeazd upand has extensions withlistencapability, answering the prompt or inputtingCtrl+Calways continues normally so we don't end up in a bad state where the extension process exits while azd continues on.AZD_EXT_DEBUG- when the user invokes custom extension commands likeazd ai agent init, extension authors can callazdext.WaitForDebuggerand handle when user declines prompt or cancels viaCtrl+C.This PR also fixes a concurrency bug that can cause prompts to freeze up, such as when running
AZD_EXT_DEBUG=true azd upwith multiple extensions installed withlistencapability. The fix involves serializing all interactive prompts inpromptServicewith a context-aware gate.