-
Notifications
You must be signed in to change notification settings - Fork 735
feat(amazonq): Use @ to add folders, files, and saved prompts as context
#6712
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
* local ws working * beta_2 * rename * update * code format * apply context cmd to all tabs * context to the api call * minimize changes * update * update * format code * update to lsp * update context commands * update context commands * clean up * beta5 * update * use lsp to resolve additionalContext
* feat(amazonq): saved prompts * fix: remove unecessary change
* feat(amazonq): saved prompts * fix: remove unecessary change * feat(amazonq): saved prompts * fix: remove unecessary change * feat(amazonq): add Create a new prompt button to context
* Add context transparency feature to Q chat @workspace * remove console log * remove console log * remove unused FileClickMessage
* feat(amazonq): saved prompts * fix: remove unecessary change * feat(amazonq): saved prompts * fix: remove unecessary change * fix: add fs exists check for ~/.aws/prompts * fix: whitespace
* fix: @workspace command * remove first instance of workspace from message
* fix: add feature flag command to context * fix: move into additional commands
* fix: refresh prompt list when project prompt is added * fix: validate length and size of additionalContents * fix: truncate additionalContents based on api validation limits * fix: move constants
* context transparency multiple fixes 1. add manually selected context from prompt into context list 2. fix -1 start/end line edge cases 3. Center selction after clicking on the file * remove console.log
## Problem This is a band-aid to temporarily set the size of `relevantTextDocuments` and `additionalContentEntry[]` combined to be lower than 40k characters, due to limitations on the service side. This PR will fix the issue when the API returns validation exception. ## Solution 1. Truncation is performed at chunk level. 2. Prioritize `additionalContentEntry[]` over `relevantTextDocuments` 3. Added TODO for a total character count indicator. --- - 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 ## 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.
## Problem Strings were hardcoded in .ts and test files. Input placeholder text did not include information about using @ to insert context ## Solution Move strings to language file, update placeholder text to match figma. --- - 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 1. If user create a file using the File>New File buttons, the onCreateFile listener does not capture it. <img width="451" alt="Screenshot 2025-02-26 at 2 46 31 PM" src="https://github.com/user-attachments/assets/e2e53d38-ca0e-413a-91f9-b2845b3549a6" /> 2. Renaming file or folders is not listened and updated. ## Solution 1. Listen to new files created by File>New File buttons 2. Listen to renaming file or folders --- - 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 In certain rare cases, when the changed file has no dot in filename, this file was misread as folders in the older LSP. Now this bug is fixed in 0.1.42 lsp. ## Solution update lsp artifact to 0.1.42 --- - 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 We need to update to mynahui beta 12 ## 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.
## Problem File list in header flickers as message is rendering (see screen recording) https://github.com/user-attachments/assets/485c665f-cde1-4ed6-a316-8cea2ac63a49 ## Solution Update to latest mynah beta. Pass `undefined` to `header` in subsequent messages (as instructed by Mynah UI team) Note: no fix in changelog needed since feature hasnt yet been released --- - 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.
This PR adds the following telemetry for falcon features: **New metric**: `amazonq_createSavedPrompt` - tracks when user creates a saved prompt using UX. Adding to commons in this [PR](aws/aws-toolkit-common#986) **Additing to existing metric**: `amazonq_addMessage` (does not exist in toolkit common): - `cwsprChatHasContextList` - true if context list is displayed to user - `cwsprChatPromptContextCount` - # of saved prompts manually added to context - `cwsprChatPromptContextLength` - Total length of saved prompts added to context - `cwsprChatPromptContextTruncatedLength` - Truncated length of saved prompts added to context - `cwsprChatRuleContextCount` - # of workspace rules automatically added to context - `cwsprChatRuleContextLength` - Total length of workspace rules added to context - `cwsprChatRuleContextTruncatedLength` - Truncated length of workspace rules added to context - `cwsprChatFileContextCount` - # of files manually added to context - `cwsprChatFileContextLength` - Total length of files added to context - `cwsprChatFileContextTruncatedLength` - Truncated length of files added to context - `cwsprChatFolderContextCount` - # of folders manually added to context Telemetry doc: https://quip-amazon.com/XRRfA9b8Ux24/Falcon-Telemetry-Toolkits-telemetry --- - 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: - We need to update copy text Solution: - Move hardcoded strings to language file - Update titles/descriptions of new Context menu options - Update welcome message to include new context menu options - Update mynah-ui to latest - add changelog for all falcon features --- - 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.
|
/runIntegrationTests |
Jurredr
left a comment
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.
Had a quick look through, LGTM! Excellent work guys.
|
E2E test failure: Amazon Q Chat Sends message is flaky, its been failing on other commits (https://d1ihu6zq92vp9p.cloudfront.net/8d73c61b-68cf-4dbd-a875-dfc44c9514fe/report.html) |
|
/runIntegrationTests |
## Problem In multiroot workspace setup, the contextList UI displays files that are deduped for the same files and doesn't resolve relative paths correctly. 1. In a multi-root workspace, the index is built on the root of the 1st project after sorting workspaceFolders, thus the chunk response also contains relativePath to the 1st project root after sorting. In order to get the same relativePath from explicit @file, we also need to use the root of the 1st project after sorting workspaceFolders. 2. Use a relativePath to projectRoot map to store the project root for each relativePath so that on clicking the file(which only returns relativePath in the event) we correctly construct the absolute path of the file to open in the editor. ## 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.
| "required": false | ||
| }, | ||
| { | ||
| "type": "cwsprChatHasContextList", |
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.
non-blocker: Are there plans to move this to the common repo? IIRC this metric was initially created here to allow you guys to move fast.
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.
Sure, looks like you already started a PR for this: aws/aws-toolkit-common#988
lmk if you want me to take over
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 if you take over that would be great. We have plans to consume this metric across all IDEs for some separate work.
Problem
Users are unable to specify files or folders to add as context in a conversation. Additionally, when using
@workspace, users don't know exactly which of their local files are being sent to Amazon Q.Solution
Users can enter
@to add folders, files, and saved prompts as context. The response from Amazon Q now displays a "Context" list with all the items sent as context.feature/xbranches will not be squash-merged at release time.