GitLab Duo Setup VSCode Preferred Account =?

I am running into a brick wall setting up Gitlab Duo in VSCode. In the settings for the GitLab Workflow extension there is the following input field:

“Ai Assisted Code Suggestions: Preferred Account”

What the h*ll is my “preferred account”!?
I have tried entering a personal access token I specifically created for VSCode…
I have tried entering my Gitlab username…
I have tried entering the url to my profile…

Nothing seems to work. Every option I try I get the same error when I attempt to start a duo chat.

“AI features are not enabled or resource is not permitted to be sent.”

Now I know AI features are enabled becuase of two reasons

  1. I enabled Code Suggestions on my profile preferences on GitLab.com
  2. The GitLab plugin for DataGrip works just dandy

The preferred account setting helps when you have multiple accounts configured in your VS Code settings (for example, one account for GitLab.com SaaS, and a second account for your self-managed instance URL). If there is just one account, the extension will use this account. In my VS Code setup, the preferred account setting is left blank.

image

Next to enabling Code Suggestions in your account, the top-level group also needs Code Suggestions enabled (group owners can do so). Code Suggestions on GitLab SaaS | GitLab

On the local client with VS Code, you can enable debug logging for the workflow extension to get more verbose output.

If this still fails, please try removing all authorization accounts in VS Code, and re-add them.

Please also check whether the workflow extension is the latest release, at the time of writing this, v3.89.0. I used Code Suggestions in VS Code today.

image

Maybe it helps - these are all my settings in VS Code for the GitLab Workflow Extension.

Thank you for the quick and detailed reply. I will give your suggestions a whirl!

1 Like