-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(chat): expansion of current-tab generic mention when non editor tabs are opened #6910
base: main
Are you sure you want to change the base?
Conversation
- This change filters out any null tab inputs from the list of open tabs, ensuring that the returned `ContextItem[]` array only contains valid tab inputs. - Without this filtering the cody://current-tabs will not expand when encountering opened windows such as VSCode Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we ever need the "wrapped in parentheses" behavior? IMO, it's not clear that improves response quality (at best, it probably just makes whatever is sent to the LLM look janky; at worst, the non-standard formatting of having parens wrap multiple code snippets might throw the LLM "off distribution)". If there is no reason to have the parens, we could just remove them entirely and save the extra parameter here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for fixing this, I agree that wrapping is actually not needed anymore (I think it was used at some point when we had one "primary" file and "other" files, but I can't think of any current usage of this where this is still important.
@beyang @vovakulikov There you are taking "the selected code" and replacing it with file:linenumber-linenumber(file) This only happens when you use the execute command and not when you call the prompt directly. explain-code-command-vs-prompt.mp4Given the fact that this doesn't happen when you call the prompt from the prompt choose, I would be in favor The reason why I kept this functionality working was because I was aware that it is used in the command execution If we are also on the topic of having parenthesis added I would set my flag to remove them also from this I chose not todo it in order to keep this pull request pure, fix only issues for current-tab replacement and get What happens from here is up to what you guys want me todo now that I have presented these situations. |
@ichim-david Sorry for the delay here (we had quite a week with our latest release), I see what you mean with commands wrapping, TL;DR commands are soft deprecated at the moment and will be replaced fully with prompts (we already reached a good enough feature parity with them in prompts library) so I wouldn't worry about commands much here. We can remove wrapping there too. |
@beyang and @vovakulikov I've removed the addition of parenthesis as you guys suggested. Once this pull request will be merged the explain command will behave like this I suggest that any cleanup made to the commands to make them act like the prompt should be made in another pull request to avoid handling another task in the same pull request. |
@beyang Actually if I remove the parenthesis now I have to fix the tests so maybe I bring back the parenthesis and the removal I make in another pull request where I get rid of them for good, what do you say? |
sounds good @ichim-david and thanks for the fix here. Anything blocking merging this now? |
@beyang this is good for merge now, as I’ve mentioned the removal of the logic that added parentheses will need to be done in another pull request along cleaning it from the commands. |
813025b
to
8430413
Compare
@vovakulikov I've moved the changes that dropped the parenthesis from the other mentions within this pull request #7022. Since you've mentioned that we could remove the wrapping from them as well I ended up removing the other mention so that the default commands no longer duplicate the context mention behaving like the default prompts that have replaced the command. See more info in the pull request. |
Here are a few short videos:
broken-current-tabs-behavior.mp4
selectedCodePromptWithExtraFiles
in order to get rid of parenthesis wrapping the
otherMentions
if we don't need it such as in the case of the current-tabs.current-tabs-with-parenthesis.mp4
and the fix:
current-tabs-without-parenthesis.mp4
Test plan