Change inline @file context cause message loss after it
Before submitting your bug report
- [X] I believe this is a bug. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that reports the same bug
- [X] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: macOS 15.0
- Continue: 0.8.52
- IDE: VSCode 1.93.1
- Model: any
- config.json:
{
"models": [
{
"model": "claude-3-5-sonnet-20240620",
"contextLength": 200000,
"title": "Claude 3.5 Sonnet",
"apiKey": "*********",
"provider": "anthropic"
}
],
"customCommands": [
{
"name": "test",
"prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
"description": "Write unit tests for highlighted code"
}
],
"tabAutocompleteModel": {
"title": "Starcoder2 3b",
"provider": "ollama",
"model": "starcoder2:3b"
},
"contextProviders": [
{
"name": "code",
"params": {}
},
{
"name": "docs",
"params": {}
},
{
"name": "diff",
"params": {}
},
{
"name": "terminal",
"params": {}
},
{
"name": "problems",
"params": {}
},
{
"name": "folder",
"params": {}
},
{
"name": "codebase",
"params": {}
}
],
"slashCommands": [
{
"name": "edit",
"description": "Edit selected code"
},
{
"name": "comment",
"description": "Write comments for the selected code"
},
{
"name": "share",
"description": "Export the current chat session to markdown"
},
{
"name": "cmd",
"description": "Generate a shell command"
},
{
"name": "commit",
"description": "Generate a git commit message"
}
]
}
Description
https://github.com/user-attachments/assets/e241ba00-def4-4221-b4d9-b9177f2dbf9d
To reproduce
- Write a prompt:
look @file1 and @file2, write code - Change
@file1to another file, the rest of message (and @file) will disappear
Log output
No logs in the console.
Thanks for the screen recording here @Joilence ! Very helpful.
My best guess is that there is some React state logic here that we are clearing out accidentally when you attempt to edit a context provider that comes before other providers. The logic for that is in this file: https://github.com/continuedev/continue/blob/3f8402af19ae010b60adaf893f06548f3cef877c/gui/src/components/mainInput/TipTapEditor.tsx
Not sure how soon we'll be able to get around to fixing but if you're interested in taking a look that would be much appreciated! 😁
https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md
Thanks for the reply! I am not familiar with React, hopefully this will catch someone else's attention :)
#2387
Thanks for the screen recording here @Joilence ! Very helpful.
My best guess is that there is some React state logic here that we are clearing out accidentally when you attempt to edit a context provider that comes before other providers. The logic for that is in this file: https://github.com/continuedev/continue/blob/3f8402af19ae010b60adaf893f06548f3cef877c/gui/src/components/mainInput/TipTapEditor.tsx
Not sure how soon we'll be able to get around to fixing but if you're interested in taking a look that would be much appreciated! 😁
https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md
Yes I came out with a fix #2387 . Was this intentional? I believe it's a better UX if a user has a long prompt and wants to change one file at the beginning it should not remove the entire prompt.
Perfect fix. It was intentional only to remove the text right after the "@", so your solution was great