Johannes Rieken 2024-04-23 14:31:38 -07:00 committed by GitHub
parent ecf68e69fc
commit 9e1974682e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View file

@ -460,6 +460,10 @@ export class InlineChatWidget {
return tail(requests)?.response?.response.asString();
}
get usesDefaultChatModel(): boolean {
return this.getChatModel() === this._defaultChatModel;
}
getChatModel(): IChatModel {
return this._chatWidget.viewModel?.model ?? this._defaultChatModel;
}

View file

@ -128,10 +128,16 @@ export class TerminalChatController extends Disposable implements ITerminalContr
// a default chat model (unless configured) and feedback is reported against that one. This
// code forwards the feedback to an actual registered provider
this._register(this._chatService.onDidPerformUserAction(e => {
if (e.action.kind === 'bug') {
this.acceptFeedback(undefined);
} else if (e.action.kind === 'vote') {
this.acceptFeedback(e.action.direction === InteractiveSessionVoteDirection.Up);
// only forward feedback from the inline chat widget default model
if (
this._chatWidget?.rawValue?.inlineChatWidget.usesDefaultChatModel
&& e.sessionId === this._chatWidget?.rawValue?.inlineChatWidget.getChatModel().sessionId
) {
if (e.action.kind === 'bug') {
this.acceptFeedback(undefined);
} else if (e.action.kind === 'vote') {
this.acceptFeedback(e.action.direction === InteractiveSessionVoteDirection.Up);
}
}
}));
}