@@ -847,8 +847,8 @@ registerThemingParticipant((theme, collector) => {
847
847
` ) ;
848
848
} ) ;
849
849
850
- function supportsKeywordActivation ( configurationService : IConfigurationService , speechService : ISpeechService ) : boolean {
851
- if ( ! speechService . hasSpeechProvider ) {
850
+ function supportsKeywordActivation ( configurationService : IConfigurationService , speechService : ISpeechService , chatAgentService : IChatAgentService ) : boolean {
851
+ if ( ! speechService . hasSpeechProvider || ! chatAgentService . getDefaultAgent ( ChatAgentLocation . Panel ) ) {
852
852
return false ;
853
853
}
854
854
@@ -896,6 +896,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
896
896
const onDidAddDefaultAgent = this . _register ( this . chatAgentService . onDidChangeAgents ( ( ) => {
897
897
if ( this . chatAgentService . getDefaultAgent ( ChatAgentLocation . Panel ) ) {
898
898
this . updateConfiguration ( ) ;
899
+ this . handleKeywordActivation ( ) ;
900
+
899
901
onDidAddDefaultAgent . dispose ( ) ;
900
902
}
901
903
} ) ) ;
@@ -945,7 +947,7 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
945
947
946
948
private handleKeywordActivation ( ) : void {
947
949
const enabled =
948
- supportsKeywordActivation ( this . configurationService , this . speechService ) &&
950
+ supportsKeywordActivation ( this . configurationService , this . speechService , this . chatAgentService ) &&
949
951
! this . speechService . hasActiveSpeechToTextSession ;
950
952
if (
951
953
( enabled && this . activeSession ) ||
@@ -1031,6 +1033,7 @@ class KeywordActivationStatusEntry extends Disposable {
1031
1033
@IStatusbarService private readonly statusbarService : IStatusbarService ,
1032
1034
@ICommandService private readonly commandService : ICommandService ,
1033
1035
@IConfigurationService private readonly configurationService : IConfigurationService ,
1036
+ @IChatAgentService private readonly chatAgentService : IChatAgentService
1034
1037
) {
1035
1038
super ( ) ;
1036
1039
@@ -1051,7 +1054,7 @@ class KeywordActivationStatusEntry extends Disposable {
1051
1054
}
1052
1055
1053
1056
private updateStatusEntry ( ) : void {
1054
- const visible = supportsKeywordActivation ( this . configurationService , this . speechService ) ;
1057
+ const visible = supportsKeywordActivation ( this . configurationService , this . speechService , this . chatAgentService ) ;
1055
1058
if ( visible ) {
1056
1059
if ( ! this . entry . value ) {
1057
1060
this . createStatusEntry ( ) ;
0 commit comments