Skip to content

Commit 2a4171a

Browse files
authored
fix: fix for button text and remove profilearn caching (aws#2137)
1 parent d397161 commit 2a4171a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

chat-client/src/client/mcpMynahUi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export class McpMynahUi {
276276
params.header.actions?.map(action => ({
277277
...action,
278278
icon: action.icon ? toMynahIcon(action.icon) : undefined,
279+
text: undefined,
279280
})) || [],
280281
}
281282
: undefined,

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/mcp/profileStatusMonitor.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export class ProfileStatusMonitor {
1818
private intervalId?: NodeJS.Timeout
1919
private readonly CHECK_INTERVAL = 24 * 60 * 60 * 1000 // 24 hours
2020
private codeWhispererClient?: CodeWhispererServiceToken
21-
private cachedProfileArn?: string
2221
private static lastMcpState?: boolean
2322

2423
constructor(
@@ -85,7 +84,8 @@ export class ProfileStatusMonitor {
8584
const response = await retryUtils.retryWithBackoff(() =>
8685
this.codeWhispererClient!.getProfile({ profileArn })
8786
)
88-
const isMcpEnabled = response?.profile?.optInFeatures?.mcpConfiguration?.toggle === 'ON'
87+
const mcpConfig = response?.profile?.optInFeatures?.mcpConfiguration
88+
const isMcpEnabled = mcpConfig ? mcpConfig.toggle === 'ON' : true
8989

9090
if (ProfileStatusMonitor.lastMcpState !== isMcpEnabled) {
9191
ProfileStatusMonitor.lastMcpState = isMcpEnabled
@@ -107,16 +107,9 @@ export class ProfileStatusMonitor {
107107
}
108108

109109
private getProfileArn(): string | undefined {
110-
// Use cached value if available
111-
if (this.cachedProfileArn) {
112-
return this.cachedProfileArn
113-
}
114-
115110
try {
116-
// Get profile ARN from service manager like in agenticChatController
117111
const serviceManager = AmazonQTokenServiceManager.getInstance()
118-
this.cachedProfileArn = serviceManager.getActiveProfileArn()
119-
return this.cachedProfileArn
112+
return serviceManager.getActiveProfileArn()
120113
} catch (error) {
121114
this.logging.debug(`Failed to get profile ARN: ${error}`)
122115
}

0 commit comments

Comments
 (0)