-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feature - Chat Agent Pinning #14716
base: master
Are you sure you want to change the base?
Feature - Chat Agent Pinning #14716
Conversation
Co-authored-by: mihaela21k <[email protected]> Co-authored-by: Fuyao Tang <[email protected]> Co-authored-by: Zidong Wang <[email protected]>
Co-authored-by: Fuyao Tang <[email protected]> Co-authored-by: mihaela21k <[email protected]> Co-authored-by: Zidong Wang <[email protected]>
@atahankilc Could you fix the linting: |
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.
Very nice, thank you for your contribution! I only have one main concern, the rest of my comments inline are rather minor.
As the UI of the chat input has changed quite a bit since this PR started, I'd suggest to integrate the pinned agent as sketched in the following screenshot: We have room below the text input for additional controls and information. For instance, we use a + icon to add context in another PR. I think it'd be great to use this room to put the agent pinning UI there as well, in the form of a @ button to e.g. pin or unpin an agent, and showing the currently pinned agent, if any, next to it. Buttons shown at this place are currently controlled here in the code: We may need to extend this a bit to allow also showing an optional text left to the button. This avoids also any interference with the changesets that may be shown above the chat input: What do you think? |
What it does
An "agent pinning" feature has been introduced to enhance the user experience in consecutive agent usage within the chat interface.
Automatic Pinning:
If a chat agent is mentioned in a prompt and there is no prior pinned agent, the mentioned agent is automatically pinned. This eliminates the need for the user to repeatedly mention the agent in subsequent prompts.
Handling New Mentions:
If a different agent is mentioned while another agent is pinned, the pinned agent remains unchanged. The newly mentioned agent is used only for the specific prompt where it is mentioned, without affecting the pinned agent.
Manual Control:
Users can manually unpin the agent through the chat interface if desired.
New Session with Pinned Agent:
A new chat session can now be initiated directly with a pinned agent.
How to test
Follow-ups
As part of this contribution, We encountered an issue with the added command
ai-chat-ui.new-chat-with-pinned-agent
. The command is expected to take a single argument of type ChatAgent | undefined. However, the function call fails when the argument is passed directly in the expected form. To make the command work, We had to pass an argument array instead, where the first item in the array is undefined, followed by the actual ChatAgent value.This behavior seems to deviate from the intended design. While this workaround resolves the issue for now, the underlying cause still needs to be investigated. The error message encountered when not using this approach is:
Error: The command 'ai-chat-ui.new-chat-with-pinned-agent' cannot be executed. There are no active handlers available for the command.
We are including this as a follow-up issue to address later and investigate why the command handler does not behave as expected when a single argument is passed directly.
Attribution
This feature was developed by @atahankilc, @ZidongWang123, @TANG839, and @mihaela21k as part of the AI Coding Exercises project in the Practical Course Software Engineering for Business Information Systems at Technical University of Munich.
Review checklist
Reminder for reviewers