-
Notifications
You must be signed in to change notification settings - Fork 663
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)
e71ffa9
to
0bdd5a3
Compare
const selector: vscode.DocumentSelector = [ | ||
{ scheme: 'file', language: 'typescript' }, | ||
{ scheme: 'file', language: 'javascript' }, | ||
{ scheme: 'file', language: 'python' }, | ||
{ scheme: 'file', language: 'java' }, | ||
{ scheme: 'file', language: 'csharp' }, | ||
{ scheme: 'file', language: 'cpp' }, | ||
{ scheme: 'file', language: 'c' }, | ||
{ scheme: 'file', language: 'go' }, | ||
{ scheme: 'file', language: 'rust' }, | ||
{ scheme: 'file', language: 'php' }, | ||
{ scheme: 'file', language: 'ruby' }, | ||
{ scheme: 'file', language: 'json' }, | ||
{ scheme: 'file', language: 'yaml' }, | ||
{ scheme: 'file', language: 'xml' }, | ||
] |
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.
Are these the only types that are supported? If so, should we include other key types such as html, css, sql, terraform, etc?
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.
This is a great point. Yeah these are all languages supported for Amazon Q integration with the VSCode's quick action menu on the code file. I can include more languages!
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 edit it to include all types of files! Thanks so much for your advice!
return autoDebugFeature | ||
} catch (error) { | ||
logger.error('activateAutoDebug: Failed to activate Amazon Q Auto Debug feature: %s', error) | ||
throw 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.
does this error/failure here block amazon q from initializing?
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.
No, this error does not block Amazon Q initialization.
The activateAutoDebug
call in codewhisperer/activation.ts
is wrapped in a try-catch that only logs a warning and continues: "Continuing extension activation despite AutoDebug feature failure"
.
return { | ||
enabled: config.get<boolean>('enabled', true), | ||
autoReportThreshold: config.get<number>('autoReportThreshold', 1), | ||
includedSources: config.get<string[]>('includedSources', []), |
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.
what is the usual length of these file details? have you tested this on large project with lots of source files?
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.
This is not needed for the current feature. It is used for future loop debug. I will remove all of codes relevant with the auto debug session.
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 have simplified the code. base to not include global diagnostic session. It is used for the future agent loop debug.
enabled: true, | ||
autoReportThreshold: 1, // Report when 1 or more errors detected | ||
includedSources: [], // Empty means include all | ||
excludedSources: ['spell-checker'], // Common sources to exclude |
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.
why is spell-checker
added as default? are there any other default files you need to add?
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 set it to be empty. This should configured by users completely
packages/amazonq/src/lsp/client.ts
Outdated
getLogger('amazonqLsp').debug('Attempting to connect AutoDebug feature to language client') | ||
|
||
// Function to attempt connection | ||
const attemptConnection = (attempt: number = 1): void => { |
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.
not a proper retry and backoff setup. you need to setup that as seperate function and use it 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.
Done
getLogger('amazonqLsp').info('Amazon Q Chat LSP activated successfully') | ||
} catch (error) { | ||
getLogger('amazonqLsp').error('Failed to activate Amazon Q Chat LSP: %s', error) | ||
throw 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.
How is the error getting propogated incase of failure. have you tested this scenario?
@@ -23,6 +23,10 @@ export async function activate(languageClient: LanguageClient, encryptionKey: Bu | |||
|
|||
const provider = new AmazonQChatViewProvider(mynahUIPath, languageClient) | |||
|
|||
// Store the provider and focusAmazonQPanel globally so AutoDebug can access them | |||
;(global as any).amazonQChatViewProvider = provider | |||
;(global as any).focusAmazonQPanel = focusAmazonQPanel |
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.
why do you need these two in global?
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.
They need to be used for sending error message through the chat interface
|
4170b5e
to
a44427f
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.