Skip to content

Commit d77d8a4

Browse files
committed
provide server-client handshake for model selection enabling
1 parent 9d5c373 commit d77d8a4

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project)
149149
{
150150
agenticMode: true,
151151
quickActionCommands: commands,
152-
modelSelectionEnabled: true,
152+
modelSelectionEnabled: ${isModelSelectionEnabled()},
153153
disclaimerAcknowledged: ${MeetQSettings.getInstance().disclaimerAcknowledged},
154154
pairProgrammingAcknowledged: ${MeetQSettings.getInstance().pairProgrammingAcknowledged}
155155
},
@@ -263,6 +263,8 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project)
263263
.let { OBJECT_MAPPER.writeValueAsString(it) }
264264
?: "[]"
265265

266+
private fun isModelSelectionEnabled() = AwsServerCapabilitiesProvider.getInstance(project).getChatOptions().modelSelection == true
267+
266268
companion object {
267269
private const val MAX_ONBOARDING_PAGE_COUNT = 3
268270
private val OBJECT_MAPPER = jacksonObjectMapper()

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -425,17 +425,6 @@ class AmazonQLanguageClientImpl(private val project: Project) : AmazonQLanguageC
425425
return CompletableFuture.completedFuture(Unit)
426426
}
427427

428-
override fun sendChatOptionsUpdate(params: LSPAny): CompletableFuture<Unit> {
429-
val chatManager = ChatCommunicationManager.getInstance(project)
430-
chatManager.notifyUi(
431-
FlareUiMessage(
432-
command = CHAT_OPTIONS_UPDATE_NOTIFICATION,
433-
params = params,
434-
)
435-
)
436-
return CompletableFuture.completedFuture(Unit)
437-
}
438-
439428
override fun appendFile(params: FileParams) = refreshVfs(params.path)
440429

441430
override fun createDirectory(params: FileParams) = refreshVfs(params.path)

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AwsServerCapabilitiesProvider.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class AwsServerCapabilitiesProvider {
3434
),
3535
history = true,
3636
export = true,
37-
mcpServers = true
37+
mcpServers = true,
38+
modelSelection = true
3839
)
3940
}
4041
}
@@ -48,6 +49,7 @@ data class ChatOptions(
4849
val history: Boolean,
4950
val export: Boolean,
5051
val mcpServers: Boolean,
52+
val modelSelection: Boolean,
5153
)
5254

5355
data class QuickActions(

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/FlareChatCommands.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const val CHAT_LIST_CONVERSATIONS = "aws/chat/listConversations"
2222
const val CHAT_OPEN_TAB = "aws/chat/openTab"
2323
const val CHAT_OPTIONS_UPDATE_NOTIFICATION = "aws/chat/chatOptionsUpdate"
2424
const val CHAT_PROMPT_OPTION_ACKNOWLEDGED = "chatPromptOptionAcknowledged"
25-
const val CHAT_OPTIONS_UPDATE_NOTIFICATION = "aws/chat/chatOptionsUpdate"
2625
const val CHAT_QUICK_ACTION = "aws/chat/sendChatQuickAction"
2726
const val CHAT_READY = "aws/chat/ready"
2827
const val CHAT_SEND_CONTEXT_COMMANDS = "aws/chat/sendContextCommands"

0 commit comments

Comments
 (0)