Skip to content

Commit ee52a41

Browse files
authored
fix(amazonq): emit failed status for amazonq_invokeLLM (#2071)
1 parent 8f6a7e6 commit ee52a41

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,25 @@ export class AgenticChatController implements ChatHandlers {
13001300
shouldDisplayMessage = false
13011301
// set the in progress tool use UI status to Error
13021302
await chatResultStream.updateOngoingProgressResult('Error')
1303+
1304+
// emit invokeLLM event with status Failed for timeout calls
1305+
this.#telemetryController.emitAgencticLoop_InvokeLLM(
1306+
response.$metadata.requestId!,
1307+
conversationId,
1308+
'AgenticChat',
1309+
undefined,
1310+
undefined,
1311+
'Failed',
1312+
this.#features.runtime.serverInfo.version ?? '',
1313+
session.modelId,
1314+
llmLatency,
1315+
this.#toolCallLatencies,
1316+
this.#timeToFirstChunk,
1317+
this.#timeBetweenChunks,
1318+
session.pairProgrammingMode,
1319+
this.#abTestingAllocation?.experimentName,
1320+
this.#abTestingAllocation?.userVariation
1321+
)
13031322
continue
13041323
}
13051324

@@ -1345,7 +1364,7 @@ export class AgenticChatController implements ChatHandlers {
13451364
'AgenticChat',
13461365
undefined,
13471366
undefined,
1348-
'Succeeded',
1367+
result.success ? 'Succeeded' : 'Failed',
13491368
this.#features.runtime.serverInfo.version ?? '',
13501369
session.modelId,
13511370
llmLatency,

0 commit comments

Comments
 (0)