Skip to content

Commit ddd3095

Browse files
committed
Rebase & disable inline chat for IAM Sagemaker users
1 parent 72be3dd commit ddd3095

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/amazonq/src/inlineChat/app.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
import * as vscode from 'vscode'
66
import { InlineChatController } from '../inlineChat/controller/inlineChatController'
77
import { registerInlineCommands } from '../inlineChat/command/registerInlineCommands'
8+
import { isSageMaker } from 'aws-core-vscode/shared'
9+
import { isIamConnection } from '../../../core/dist/src/auth/connection'
10+
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
811

912
export function init(context: vscode.ExtensionContext) {
10-
const inlineChatController = new InlineChatController(context)
11-
registerInlineCommands(context, inlineChatController)
13+
if (!(isSageMaker() && isIamConnection(AuthUtil.instance.conn))) {
14+
const inlineChatController = new InlineChatController(context)
15+
registerInlineCommands(context, inlineChatController)
16+
}
1217
}

packages/amazonq/src/inlineChat/provider/inlineChatProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class InlineChatProvider {
120120
let response: GenerateAssistantResponseCommandOutput | undefined = undefined
121121
session.createNewTokenSource()
122122
try {
123-
response = await session.chat(request)
123+
response = await session.chatSso(request)
124124
getLogger().info(
125125
`response to tab: ${tabID} conversationID: ${session.sessionIdentifier} requestID: ${response.$metadata.requestId} metadata: ${JSON.stringify(
126126
response.$metadata

0 commit comments

Comments
 (0)