aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.42k stars 357 forks source link

"command aws.amazonq.rejectCodeSuggestion not found" if connection expired #3509

Open DustyLamp opened 1 year ago

DustyLamp commented 1 year ago

Problem

command 'aws.codeWhisperer.rejectCodeSuggestion' not found keeps popping up when I press escape when a suggestion is made and I want to dismiss it.

Note: I'm using Copilot and Code Whisperer at the same time.

Steps to reproduce the issue

Expected behavior

System details (run the AWS: About Toolkit command)

I'm using copilot and aws code whisperer at the same time.

disbelief commented 1 year ago

This happens for me even when I've explicitly disabled code whisperer in the AWS extension config

justinmk3 commented 1 year ago

Duplicate #3490

AWS Toolkit 1.76 includes a fix for this. https://github.com/aws/aws-toolkit-vscode/pull/3518

Can you confirm you are using AWS Toolkit 1.76

dreamorosi commented 1 year ago

Hi @justinmk3 I'm using AWS Toolkit 1.76 like you suggested in the previous comment but I'm still seeing the error, even though I have disabled code whisperer in the workspace:

image Screenshot 2023-06-10 at 12 17 12

Only thing left to do is disable the extension entirely.

Will-ShaoHua commented 1 year ago

hi @dreamorosi, by "I have disable codewhisperer in the workspace", do you mean you have signed out from either Aws-builderId or Aws-Identity-center and also curious at that point of time, what's the UI you can see on CodeWhisperer node in the toolkit panel? Thanks!

Will-ShaoHua commented 1 year ago

hi @disbelief, could you elaborate more on the step you mentioned disabled code whisperer in the AWS extension config, what config did you change then? Thanks!

disbelief commented 1 year ago

@Will-ShaoHua I actually ended up just disabling the entire AWS extension for my workspace. I thought it was possible to disable code whisperer in the extension settings, but you can only turn off some of its features:

Screenshot 2023-06-11 at 09 03 56

However after updating to the latest version of the AWS extension (and restarting VS Code) I'm not having this problem anymore.

Will-ShaoHua commented 1 year ago

Hi @disbelief, gotcha, yea I think we might need to make our UI more intuitive so that ppl won't be confused when they plan to disable it :) . So "disable" codewhisperer in the current product spec, we will be referring to "disconnect" from codewhisperer. Thus we should click on the smal unplugl icon next to the connection shown.

Screenshot 2023-06-11 at 2 29 10 AM

However this issue will still happen if there are multiple inline suggestion providers, thus if you enable both CodeWhisperer and Copilot at the same time, you will still see this error, which we are actively tracking. But you shouldn't see this error pop out when you are disconnected from codewhisperer. If that's happening then we have a bug lol

dreamorosi commented 1 year ago

Hey @Will-ShaoHua, in my case the connection expired and I didn't log in again.

While it's true that I didn't actually remove the connection, I'm also not connected so I would expect CodeWhisperer to be disabled & not setting any event listener:

Screenshot 2023-06-11 at 11 59 30

If I remove the connection using the button you highlighted above the warning disappears.

I still think that there should be no warning unless CodeWhisperer is enabled (i.e. auto suggestions are on), connected, and with active credentials.

Will-ShaoHua commented 1 year ago

@dreamorosi understood, yea agree, that's a valid point, we should fix this. Thanks for the reply, that's really helpful!

kisamoto commented 10 months ago

I'm trying to use Code Whisperer but also receiving this meaning I cannot dismiss suggestions (very frustrating).

AWS Toolkit v1.86.0 OS: Linux VSCode version: 1.81.1

Will-ShaoHua commented 10 months ago

@kisamoto do you have other inline suggestions provider (e.g. Copilot, Gitlab extensions etc.) installed? also could you provide me a screenshot of CodeWhisperer panel in your VSC editor? thanks

leigaol commented 5 months ago

@kisamoto can you try the latest AWS Toolkit for VS Code release? It should have fixed this issue for you.

kisamoto commented 5 months ago

@leigaol I'm afraid I have now switched from CodeWhisperer to Copilot and don't have the capacity to try to replicate. Sorry about that.

rduan commented 5 months ago

I can confirm this error is still there, I am using the AWS Toolkit v2.8.0 with mac , vscode 1.86.0

command 'aws.codeWhisperer.rejectCodeSuggestion' not found

Will-ShaoHua commented 5 months ago

hey @rduan, thanks for reporting to us. One thing I want to verify with you do you have other completion provider extension installed in your VSCode, e.g. Copilot, Tabnine etc. Asking because this error is reproducible by installing these kinds of extensions. Thanks!

quisido commented 5 months ago

do you have other completion provider extension installed in your VSCode

I can confirm that this happens when Google Cloud Code Duet AI is installed.

IgorGanapolsky commented 1 month ago

This is still happening in 2024, in VS Code 1.89.1

justinmk3 commented 1 month ago

@IgorGanapolsky using the Amazon Q: About command, can you share the exact version of Q you are using? also AWS: About if you are using AWS Toolkit.

IgorGanapolsky commented 1 month ago

@justinmk3

zsh: command not found: Amazon zsh: command not found: AWS:

justinmk3 commented 1 month ago

The command is a vscode command. Use the vscode command palette, then search for Amazon Q: About

IgorGanapolsky commented 1 month ago

@justinmk3

OS: Darwin arm64 23.5.0 Visual Studio Code extension host: 1.89.1 Amazon Q: 1.6.0 node: 18.18.2 electron: 28.2.8

Will-ShaoHua commented 1 month ago

@IgorGanapolsky curious do you happen to have other inline suggestion extensions installed in your IDE? e.g. copilot, tabnine, gitlab workflow etc. We're aware of this bug can be reproed by conflicting inline suggestion providers

IgorGanapolsky commented 1 month ago

@Will-ShaoHua I definitely have all of the aforementioned code assistants installed. But none of them give me the error that Q does......

Will-ShaoHua commented 1 month ago

@IgorGanapolsky, thanks for the confirmation.

none of them give me the error that Q does......

Yea on this part, i would say the root cause is our own implementation therefore you won't see same issue from other AI extensions...

I will cut a ticket to our team to track down this tech debt

nagdeepanjan commented 4 weeks ago

This issue is there there. I am getting the error: "command 'aws.amazonq.rejectCodeSuggestion' not found" I am using VS Code 1.90. I am using Amazon Q 1.9.0

I am using CoPilot. I am using Amazon Q but PAUSED it and unchecked all options. I mostly use Amazon Q's chatbot feature. I use Google IDX too and have the same problem.

dgokcin commented 4 weeks ago

@nagdeepanjan, you can add the following to your settings.json to unmap the Esc key for Amazon Q as a workaround. However, I think this behavior needs to change. It does not make any sense for a disabled extension to error out like this. If you are using vim/neovim, it makes the extension unusable.

  {
    "key": "escape",
    "command": "-aws.amazonq.rejectCodeSuggestion",
    "when": "aws.codewhisperer.connected && inlineSuggestionVisible && !editorReadonly"
  }
deepanjannag commented 3 weeks ago

@nagdeepanjan, you can add the following to your settings.json to unmap the Esc key for Amazon Q as a workaround. However, I think this behavior needs to change. It does not make any sense for a disabled extension to error out like this. If you are using vim/neovim, it makes the extension unusable.

  {
    "key": "escape",
    "command": "-aws.amazonq.rejectCodeSuggestion",
    "when": "aws.codewhisperer.connected && inlineSuggestionVisible && !editorReadonly"
  }

Thank you so much!