Skip to content

Keybindingstop #7177

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

Draft
wants to merge 74 commits into
base: master
Choose a base branch
from
Draft

Keybindingstop #7177

wants to merge 74 commits into from

Conversation

yueny2020
Copy link
Contributor

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.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

aws-toolkit-automation and others added 30 commits April 14, 2025 11:25
## Problem
- we want a chat mode where agents are served by the local extension
while the regular "Chat" is served by flare

## Solution
- register mynah ui webview providers depending on lsp/normal
implementation
- temporarily disable the lsp (explain, fix, etc) commands, since they
are also registered in the normal "agent" flow
- redirect agent messages to the correct chat handler on the UI side
- redirect UI messages meant for agents to the extension side
- refactor main.ts so that it can be used by both the regular
implementation and the lsp one ~(I'll open a seperate PR to merge this
into master, since it's going to be a pain to maintain)~
    - aws#7033
- pass in references to mynah handlers so that mynah ref injection can
happen after in flare
    - aws#7046


Depends on ~aws#7033,
aws#7046

Related to aws/language-servers#962

---

- 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
currently tabs get added to the tabs storage when the onTabAdd handler
gets called.

In hybrid chat, the onTabAdd handler will never get called, because it
first needs to be in the tabsStorage, which doesn't happen because the
onTabAdd handler hasn't been called

## Solution
in hybrid chat mode just add new tabs directly to the tabs storage


---

- 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
When switching between different manifests, a newly downloaded version
might chronologically be older than all previously downloaded versions,
even though it's marked as the latest version in its own manifest. This
is why we are getting the EPIPE error when trying out the alpha
manifest. The cleanup deletes the language server right after it was
downloaded

## Solution
In such cases, we skip the cleanup process to preserve this version.
Otherwise we will get an EPIPE error. At this point the version that was
downloaded shouldn't be delisted, so we don't want to make sure its not
removed

---

- 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
- developer profiles are only synced to our local agents (/dev, /doc,
etc). Now that the main chat panel is served by flare we need to update
the profile information when it becomes available so that flare is using
the correct profile for the request

## Solution
- send profile information to flare on the initial request + subsequent
changes to the active profile
- refresh the webview if the profile changes 

---

- 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
when the flare chat panel refreshes on log in/log out, the message
listener never gets disposed of, causing the next webview instantiation
to have two message listeners that are forwarding messages to the ui

## Solution
dispose of the message listener when the webview gets disposed

---

- 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
local workspace context has been added to flare and its needed for
falcon changes

## Solution
we don't have `aws.q` settings in vscode so we have to use the language
server middleware to send back the settings

Once local workspace context is fully working and in the manifest I'll
uncomment

---

- 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
Minor update on WS setup instructions. 


## 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
If you currently ask Q any questions about cursor position or
highlighted text, it lacks the context necessary to answer. This is
because in the payload sent to the LSP we send the cursor position as
the wrong type:

https://github.com/aws/aws-toolkit-vscode/blob/2e8d4c7eb0f0bcbc416d8f6e06ff7e00d57dc6b2/packages/amazonq/src/lsp/chat/messages.ts#L159
whereas
[Flare](https://github.com/aws/language-server-runtimes/blob/d9960b5dd6df52c52309f0a7edae64a824da9003/types/chat.ts#L82)
is expecting: `cursorState`.

## Solution
- Convert the vscode selection to a Flare cursorState. 
- Add stronger typing by casting the params to `ChatParams` type before
modifying to avoid these types of bugs.

## Future Work
- This fixes flare being unable to identify cursor position, and mostly
fixes highlighted text. However, I was still able to run into situations
where the cursor position is correct, but the content is incorrect.
~~This could be fixed by sending the highlighted content to Flare, but~~
still trying to root cause the issue.

<img width="1064" alt="image"
src="https://github.com/user-attachments/assets/35e6fbc9-5c66-4f9f-8c6e-bf9ec4ab4ef2"
/>

---

- 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.
When certain settings/configs are changed in the IDE, they need to be
propagated to the language server.
The settings were the customizationArn, the users opt in preference for
telemetry, and some other things.

This PR:
- Pushes the new customization arn when it is changed. This arn only
exists when the user is using the non-default customization, otherwise
it is undefined.
- A small hack needed to be made to explicitly push this change, since
by default we utilized the automatic push to the LS when the users
settings file changed (eg opt in telemetry). But because customization
is not stored in the users settings, we didn't get that for free. See
the command `aws.amazonq.updateCustomizations` which was made to handle
this edge case. Which eventually **explicitly** uses the language server
message `DidChangeConfigurationNotification`
- Pushes the opt out telemetry setting to the language server
- Since this setting is stored in the vscode settings json, the push to
language server mechanism comes for free under the
`DidChangeConfigurationNotification` message.
- The Q Auth Profile ARN is a separate config that needed to be handled
by a different handler (different from customization), so the function
`pushConfigUpdate()` was created to route the correct config to the
correct handler in the LS
- This uses the message `updateConfigurationRequestType` which is
different from `DidChangeConfigurationNotification` that the other
configs use. This results in a different code path being hit, which is
expected.

Some helpful notes:
- `getAmazonQRelatedWorkspaceConfigs()` (triggered through
`DidChangeConfigurationNotification`) is the language server side code
that parses the config sent by the client/ide. So the client/ide must
match the shape expected by the LS. This is an example why
`optOutTelemetry` did not work out of the box, and needed some changes
to be consumable by the LS.


---

- 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.

---------

Signed-off-by: nkomonen-amazon <[email protected]>
Co-authored-by: Josh Pinkney <[email protected]>
## Problem
agentic chat should have a pair programming card that appears at the top
of chat

## Solution
implement it with the following behaviors:
1. If the pair programming card was dismissed in a previous session,
never show it again
2. Continue showing the pair programming card in new basic chat tabs
until you click the "X" to dismiss it. Once the "X" is pressed it will
never be shown for future tabs in the current chat-client session or
future sessions
3. If you have multiple basic chat tabs open and click X on one of them
it only closes the programmer mode card for that single tab

depends on: aws/language-servers#1023

---

- 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.
ctlai95 and others added 29 commits April 22, 2025 16:26
## Problem
ChatUpdate notifications are not getting forwarded to UI

## Solution
Forward chat update notification

---

- 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
Reloading the webview directly causes export/history to be missing

## Solution
Add a specialized handler that simulates reloading the webview when a
profile changes, rather than actually refresh everything. This is
required because the chat-client relies on initializedResult values from
the language server that are only sent once

---

- 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.
…7138)

Reverts aws#7118

We were getting throttled because of
aws#7060. That's been
reverted so we should be safe to re-enable this
… cwc chat (aws#7144)

## Problem
cw chat is still registered and sending events to the frontend, in some
cases those UI handlers are the same as they are on the chat-client.
This causes disruptive behavior to happen like "normal" chat tabs being
restored when they shouldn't

## Solution
disable restoreTabMessage, contextCommandData

## TODO
get rid of cw app start up

---

- 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.
…ism (aws#7146)

## Problem
It's not obvious that the LSP language client passes on telemetry events
to Toolkits Telemetry

## Solution
Add clarifying comment to the code implementation

---

- 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:

When downloading the LSP artifacts from the manifest, there are some
large ones (100+ MB).
For a slow connection this can take 1+ minutes, but our timeout for the
"downloading" message
is set to disappear much earlier. So it is still downloading in the
background, but the message
has disappeared and the user thinks that the download is done.

## Solution:

Increase the timeout to 30 minutes, which will ensure the downloading
message sticks around
while the download is still happening.

## Additional

In another commit this fixes a separate HTTP client bug where it would
time out a request if it took longer than 3 seconds.
This caused downloads to be aborted (separate from the download message
disappearing). Now it times out after 30 minutes.


---

- 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.

Signed-off-by: nkomonen-amazon <[email protected]>
)

## Problem
toolkit commons needs to be updated so that telemetry events from flare get sent to kibana

## Solution
- bump aws-toolkit-common version from 1.0.312 to 1.0.316

---

- 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
race conditions can occur with getConnectionMetadata

## Solution
instead send the start url through the token update. When it's done this
way you don't need to [set
getConnectionMetadata](https://github.com/aws/language-server-runtimes/blob/5ba754af403a6f35cd771f27efb987c1580ae6b5/runtimes/runtimes/auth/auth.ts#L158)


---

- 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.
…#7154)

## Problem
- UI styles coming from flare and the local instance are conflictin.

## Solution
- Latest production version of mynah-ui has the ability to avoid loading
styles. Bumped up mynah-ui version and set `loadStyles` to `false`.

---

- 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:

When the server restarted due to a crash, the auth token was not sent
again. This caused users to run in to the state where if it crashed and
restarted, when they sent a subsequent chat message they'd get stuck
with the server asking the user to Authenticate.

Note that server restart is triggered automatically by the
LanguageClient, I think.

## Solution:

Detect when the server is restarted and manually resend the bearer token
again.

Note, this solution needs to be revisited since there may be other
initialization logic that needs to run on server restart, aside from
just the bearer token.

## Repro Steps:

1. Ensure you do not have a workspace open, you can open a new vscode
window at the top left `File` > `New Window`
2. Make a random folder in your home directory
3. Make a couple typescript files in that folder
4. Send the prompt: `list all files in {folder}`
5. Accept the permissions
6. Click the toggle drop down from the response, and click the link to
the path (this is just to force a crash + restart)
7. Verify the server crashed in the logs, look for the message
`Connection to server got closed. Server will restart.`
8. ASSUMING this fix worked, the server will restart automatically and
you can continue using chat. Before this fix any subsequent messages
would ask the user to `Authenticate` again

---

- 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.

Signed-off-by: nkomonen-amazon <[email protected]>
## Problem
- toolkit commons needs to be updated so that certain telemetry events
from flare have `languageServerVersion`

## Solution
- bump aws-toolkit-common version from 1.0.316 to 1.0.317
- remove `amazonq_messageResponseError` because it was uplifted to
common: aws/aws-toolkit-common#1019
## Problem
If the server sends a partial result without a body, we currently ignore
it.

## Solution
- explicitly check for undefined. 

---

- 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
The LSP server accepts local VSCode workspace configurations for AmazonQ
upon initialization, but they are not being passed to the client by the
VSCode extension. See
https://github.com/aws/language-servers/blob/main/server/aws-lsp-codewhisperer/src/shared/amazonQServiceManager/configurationUtils.ts

## Solution
* Add missing settings for file indexing to the extension
* Pass the workspace settings to  Flare when the client is instantiated

## Testing
<img width="997" alt="Screenshot 2025-04-24 at 19 00 59"
src="https://github.com/user-attachments/assets/e8b8b977-1bb0-4796-b864-f0b570557fc2"
/>

I confirmed that Flare is receiving the data and that it can parse it

---

- 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
Response errors returned by the LSP are returned to chat after
prepending a custom error message. We can remove this custom error
message and rely on flare for a single implementation of this error
message.


## Solution
- perform a sanity check on the response before casting it to the proper
type.
- log the last result from the language server to help debug. 
- include the requestId clearly in the logs. 

<img width="1061" alt="image"
src="https://github.com/user-attachments/assets/fd71ed26-7266-47ee-9204-c1ec412ca452"
/>



---

- 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
401 and CSP errors when launching hybrid chat on windows

## Solution
fix paths

---

- 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.
## Automatic merge failed

- Resolve conflicts and push to this PR branch.
- **Do not squash-merge** this PR. Use the "Create a merge commit"
option to do a regular merge.

## Command line hint

To perform the merge from the command line, you could do something like
the following (where "origin" is the name of the remote in your local
git repo):
```
git stash
git fetch --all
git checkout origin/feature/hybridChat
git merge origin/master
git commit
git push origin HEAD:refs/heads/autoMerge/feature/hybridChat
```

---------

Signed-off-by: nkomonen-amazon <[email protected]>
Co-authored-by: Nikolas Komonen <[email protected]>
Co-authored-by: Hweinstock <[email protected]>
Co-authored-by: nkomonen-amazon <[email protected]>
…ws#7169)

## Problem
explain, refactor, fix, optimize right click menus aren't working

## Solution
re-enable them through flare's genericCommand message

## TODO
- handle generateUnitTests
- handle explainIssue
both of these need flare API changes to send generic prompts from the
frontend to the backend

---

- 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
context items should be always on and not controlled by workspace
setting
there need to be a separate setting to control @workspace indexing, out
of scope for this PR

## 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
The current viewDiff implementation is restricted to only allowing
comparing the current file contents. This means it's not possible to
view a diff for a change that was applied at a previous point in time.

## Solution
- Create a new `DiffContentProvider` that can support showing multiple
URIs in the same scheme. The current `ContentProvider` has a limitation
that it can only show a single URI.
- Refactor the code to use a defined type `ViewDiffMessage` instead of
`any`
- Change the logic so that diffs are stored in memory instead of a temp
file on disk

---

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.