DuoChat: Duo chat will update the description of an MR if open on separate tab.
Checklist
-
I'm using the latest version of the extension (see the latest version in the right column of this page) - Extension version:
v5.19.0
- Extension version:
-
I'm using the latest VS Code version (find the latest version here) - VS Code version:
1.95.3 (Universal)
- VS Code version:
-
I'm using a supported version of GitLab (see README for the supported version) - GitLab version: happens on
gitlab.com
- GitLab version: happens on
Summary
When editing an MR description in a separate tab, if you ask Duo Chat a question, the question asked and the answer from Duo Chat will be written into the open MR description editor page.
Related discussion on Slack (internal):
Related gitlab.com issue:
Steps to reproduce
Reproduction Path 1
- From gitlab UI, start editing the description of a MR
- Leave the MR open in edit mode, then open Duo Chat inside of VS code
- Highlight some code and use the /explain command, note Duo responds in the chat
- Go back to the MR you were editing and note that the Duo response was also added in there
Note: This behavior doesn't seem to be specific to slash commands. If you are editing an MR, then anything you type in Duo Chat in VS Code and anything Duo says will be put into the MR description as well.
Reproduction Path 2
- From gitlab UI, go to an MR and Open the code in the
Web IDE - From gitlab UI, start editing the description of the MR
- Leave the MR open in edit mode, go back to the Web IDE page
- Highlight some code and use the /explain command, note Duo responds in the chat
- Go back to the MR you were editing and note that the Duo response was also added in there
Things To Note
- The code you are editing both in the VSCode IDE and the WebIDE must be within the same project as the MR that you are editing.
What is the current bug behavior?
When asking Duo Chat a question while having an MR page open and in edit mode, it will input the Duo Chat question asked and the response into the MR description that is being edited on a seperate tab in the web browser.
What is the expected correct behavior?
Duo Chat requests and responses should not update the MR description at all.
Relevant logs and/or screenshots
Possible fixes
- The current fix that is going to be put in place for this is to remove the
resourceIdfrom within thesendAiActionmethod.