Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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