-
Notifications
You must be signed in to change notification settings - Fork 349
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
…arenthesis - This change adds an optional `wrapJoinedMentions` parameter to the `selectedCodePromptWithExtraFiles` function. - When `wrapJoinedMentions` is `true` (the default), the joined mentions will be wrapped in parentheses. - This allows PROMPT_HYDRATION_MODIFIERS to return results without any (). Especially useful when using cody://current-tabs
- This ensures that the results returned by `hydrateWithOpenTabs` do not contain any unnecessary parentheses.
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. |
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