aws-toolkit-vscode: "command aws.amazonq.rejectCodeSuggestion not found" if connection expired

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.

  • OS: mac
  • Visual Studio Code version: 1.78.2
  • AWS Toolkit version: 1.74.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 23
  • Comments: 33 (14 by maintainers)

Most upvoted comments

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

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.

@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!

@nagdeepanjan, you can add the following to your keybindings.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"
  }

@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

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

It is fixed in release 1.23.0 Amazon Q for VS Code. Please let us know if you encounter this issue again. Thanks!

Should be fixed by https://github.com/aws/aws-toolkit-vscode/pull/5482. I tested a build after this fix with Copilot installed and I can no longer reproduce the command not found issue.

Same issue

AWS toolkit v3.18.0 Amazon Q v1.19.0 No other inline tools/ai tools (like copilot) and no CodeWhisperer (what ever that is) MacOS

image

I can see it in the settings - pretty surer this is literally just a : image

My workaround was to right click on that and select remove binding

@sascharo yes keybindings.json not settings.json. I edited my answer 🙃

@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"
  }

@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!

Do you mean adding it to keybindings.json?

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.

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

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