Skip to content
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

chore(chat): pass pinned agent in frontend chat service #15070

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

planger
Copy link
Contributor

@planger planger commented Feb 27, 2025

What it does

Support setting a pinnedAgent also in the frontend service.

Reported in #15053 (comment)

How to test

Everything should work as before when creating new chats. However, now commands can also specify a pinned agent via the frontend service, e.g.

@injectable()
export class SampleCommandContribution implements CommandContribution {

    @inject(ChatService)
    protected readonly chatService: ChatService;


    @inject(ChatAgentService)
    protected chatAgentService: ChatAgentService;

    registerCommands(commands: CommandRegistry): void {
        commands.registerCommand(SampleCommand, {
            execute: async () => {
                 const agent = this.chatAgentService.getAgent('Coder');
                // creates a clean session
                const session = this.chatService.createSession(ChatAgentLocation.Panel, { focus: true }, agent);
                // submit a request
                await this.chatService.sendRequest(session.id, { text: 'Hello World!' });
            }
        });
    }
}

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@planger planger requested a review from eneufeld February 27, 2025 08:32
Copy link
Contributor

@eneufeld eneufeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@planger planger merged commit 3b6c068 into master Feb 28, 2025
9 of 11 checks passed
@planger planger deleted the planger/adapt-chat-service-pinned-agent branch February 28, 2025 09:15
@github-actions github-actions bot added this to the 1.60.0 milestone Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants