Agentic Chat in VS Code Fails with SSH Alias Remote

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

While using the GitLab Duo VS Code extension, I encountered an issue where Agentic Chat fails to initialize when a repository is cloned using a custom SSH alias defined in ~/.ssh/config.

💡 Context

I manage multiple GitLab accounts using SSH aliases like:

Host gitlab1
  HostName gitlab.com
  User git
  IdentityFile ~/.ssh/id_gitlab1

Repos are cloned like:

git clone git@gitlab1:gitlab-com/group/project.git

This works fine for Git and the Duo web UI, but Agentic Chat in VS Code doesn’t activate in this configuration.

Workaround

Adding a second remote with the standard GitLab format resolved the issue:

git remote add duo-origin git@gitlab.com:gitlab-com/group/project.git

After this, Agentic Chat began working correctly in VS Code.

Implementation

Update the following logic to replace aliased host with actual gitlab webhost in case of SSH aliasing. Possibly worth creating a separate option to avoid tweaking existing SSH clone behavior by using the un-aliased hostname.

Language server:

VS Code extension:

/cc @erran

Edited by 🤖 GitLab Bot 🤖