void icon indicating copy to clipboard operation
void copied to clipboard

[Bug] "Add to Chat": Discrepancy between displayed line reference and actual code processed by AI

Open lijiapeng365 opened this issue 8 months ago • 1 comments

  1. Press Cmd+Shift+P in Void, and type Help: About. Please paste the information here. Also let us know any other relevant details, like the model and provider you're using if applicable. 版本: 1.99.30033 (system setup) 提交: 1.3.9 日期: b7bb7f2f949a5267274d184a2b7665dc4aa05112 Electron: 2025-05-14T06:04:52.797Z ElectronBuildId: 34.3.2 Chromium: undefined Node.js: 132.0.6834.210 V8: 20.18.3 OS: 13.2.152.41-electron.0
  2. Describe the issue/feature here! When selecting a portion of code in the editor with the mouse and then clicking the "Add to Chat" button, the AI chat window might correctly display a reference to the selected line numbers. However, based on the AI's response or its subsequent behavior, it appears to have actually read, processed, or understood a different segment of code, not the code the user actually selected. As shown in the attached screenshot, the chat window's reference points to the selected lines 35-37, but the AI's understanding seems to be based on the content of lines 31-33.

Image

After multiple attempts, I found that there is a certain probability of correct application, but in many cases, reference errors still occur.

lijiapeng365 avatar May 14 '25 08:05 lijiapeng365

Thanks for the report! We're currently getting the file contents of the selection when you click send, not when you attach the message. I think that's the problem. This makes sense for full files, but we should probably do it the other way for CodeSelections (line-numbered). Will leave this open

andrewpareles avatar May 14 '25 08:05 andrewpareles

Hi, can I work on this ?

praburocking avatar Jul 04 '25 11:07 praburocking

@andrewpareles @vrtnis ?

praburocking avatar Jul 06 '25 17:07 praburocking

@praburocking sounds great.. feel free to take this on!

vrtnis avatar Jul 06 '25 17:07 vrtnis