-
Notifications
You must be signed in to change notification settings - Fork 661
feat(amazonq): Auto Debug Functionality #7609
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
base: feature/auto-debug
Are you sure you want to change the base?
Conversation
… ## Problem - to reduce # of service calls within short time duration and result in throttling error thrown - ## Solution --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
…ble deployment from WFS (aws#7315) ## Problem - Save telemetry was being recorded for all document saves in VS Code, not just for the active workflow studio document. - Save & Deploy functionality required closing Workflow Studio before starting deployment ## Solution - Add URI comparison check to ensure telemetry is only recorded when the saved document matches the current workflow studio document. - Refactored publishStateMachine.ts to accept an optional TextDocument parameter and updated activation.ts to support new interface - Removed closeCustomEditorMessageHandler call from saveFileAndDeployMessageHandler --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Diler Zaza <[email protected]>
## Problem Instead of running `mvn dependency:copy-dependencies` and `mvn clean install`, we have a JAR that we can execute which will gather all of the project dependencies as well as some important metadata stored in a `compilations.json` file which our service will use to improve the quality of transformations. ## Solution Remove Maven shell commands; add custom JAR execution. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: David Hasani <[email protected]>
## Problem Minor text update request. ## Solution Update text. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: David Hasani <[email protected]>
## Problem step functions still uses sdk v2 ## Solution - Refactor `DefaultStepFunctionsClient` to `StepFunctionsClient` using ClientWrapper. - Refactor references to `DefaultStepFunctionsClient` with `StepFunctionsClient` and reference sdk v3 types ## Verification - Verified CreateStateMachine, UpdateStateMachine works and creates/updates StateMachine - Verified AWS Explorer lists all StateMachines using ListStateMachine - Verified StartExecution works - Verified TestState, ListIAMRoles works in Workflow Studio, which also fixes the bug that variables cannot be used in TestState in Workflow Studio - fixes aws#6819  --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
## Problem Modify text in some places, and modify the manifest to include the `IDE` field. ## Solution Above --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: David Hasani <[email protected]>
1. update the commonAuthViewProvider to use the locally bundled vue.js, instead of to load the vue.js from CDN. 2. this going to resolve the customer request that When customer is trying to login to IDC via Q they are hitting a URL which is not part of the whitelist urls as per [documentation](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/firewall.html)
* This uses the same method as explainIssue command which works properly | ||
*/ | ||
public async sendChatMessage(message: string, eventId: string): Promise<ChatResult> { | ||
this.logger.info('AutoDebugLspClient: Sending message via webview postMessage') |
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.
Combine these logs into a single one
}, | ||
}) | ||
|
||
this.logger.info('AutoDebugLspClient: ✅ Message sent successfully via webview postMessage') |
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.
Same here
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.
I just fixed this!
* AutoDebug LSP client that uses the regular Amazon Q chat pipeline | ||
* This ensures the response appears in the chat UI and can be processed by the language server | ||
*/ | ||
export class AutoDebugLspClient { |
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.
Do we need another client?
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.
Yeah because certain dependencies are not available at core side.
* This ensures perfect compatibility with the language server integration | ||
*/ | ||
export function activateAutoDebug(client: LanguageClient, encryptionKey: Buffer): AutoDebugLspClient { | ||
logger.info('AutoDebug: Activating AutoDebug LSP client using exact inline chat pattern') |
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.
Can we combine these into a single log
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.
Yeah sure! Sorry I forgot to make changes to this one before!
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.
It was fixed!
context.extensionContext.subscriptions.push(autoDebugFeature) | ||
getLogger().debug('AutoDebug feature added to extension subscriptions') | ||
} catch (error) { | ||
getLogger().error('Failed to activate AutoDebug feature: %s', error) |
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.
Duplicate logs
e71ffa9
to
0bdd5a3
Compare
Problem
Amazon Q users currently face significant challenges when debugging code errors in VS Code:
This disconnect between VS Code's powerful diagnostic capabilities and Amazon Q's AI assistance creates friction in the development workflow, resulting in longer debugging cycles and reduced productivity.
Solution
Implemented a comprehensive Amazon Q Auto Debug System that bridges VS Code's diagnostic ecosystem with Amazon Q's AI capabilities through an intelligent, event-driven architecture. This system provides proactive error detection with smart notifications and seamless AI-powered debugging assistance.
High-Level Auto Debug Workflow
File Save/Open → Diagnostic Capture → Baseline Comparison → Smart Filtering → Multi-Fallback Notifications → Amazon Q Integration
Detailed Flow:
Architecture & Component Structure
Core System Architecture
AutoDebugFeature (Orchestration Layer - 320 lines)
AutoDebugController (Business Logic Engine - 600 lines)
Diagnostic Processing Pipeline
DiagnosticsMonitor (Diagnostic Capture Engine - 180 lines)
ProblemDetector (Intelligence Layer - 200 lines)
AI Integration & Context Assembly
ErrorContextFormatter (Context Enrichment - 220 lines)
AutoDebugLspClient (Communication Layer - 250 lines)
User Interface Integration
ContextMenuProvider (Right-Click Integration - 200 lines)
AutoDebugCodeActionsProvider (Light Bulb Integration - 150 lines)
Extension Integration
Activation System (Extension Bootstrap - 100 lines)
Intelligent Workflow Implementation
Event-Driven Problem Detection
Multi-Fallback Notification System
Amazon Q Integration Architecture
IDE Integration Features
New Functionalities
Intelligent Error Detection
Proactive Multi-Fallback Notifications
AI-Powered Batch Processing
Comprehensive IDE Integration
Advanced Configuration Options
Unit Test Design & Coverage
Comprehensive Test Strategy
Implemented 95%+ code coverage across all components with systematic edge case testing:
AutoDebugFeature Tests (12 test categories, 35+ test cases)
AutoDebugController Tests (15 test categories, 45+ test cases)
Edge Cases & Robustness Testing
Input Validation & Error Handling
Performance & Scalability
VS Code Integration Robustness
Mock Strategy & Test Infrastructure
Benefits of This New Feature
Enhanced Development Experience
Improved Developer Productivity
Technical Architecture Advantages
Configuration & Customization
Users can fine-tune the Auto Debug experience through comprehensive VS Code settings:
Configuration Options:
Integration & Activation
The Auto Debug system integrates seamlessly with existing VS Code extensions through a clean activation API:
Screenshots
Auto.detect.and.fix.mov
Fix.with.Amazon.Q.mov
QuickFix.and.Explain.with.Amazon.Q.mov
feature/x
branches will not be squash-merged at release time.