Skip to content

fix: chat API errors are logged

Tomas Vik requested to merge tv/2024-10/fix-chat-logging into main

Description

This MR adds logging for chat API errors. Until now we only shown partial error message to the user.

This was a big issue during one customer escalation where they shared logs but the key error wasn't in them.

image

Related Issues

Fixes one of the issues with [Duo Chat] Stop sending additional context to o... (#1591 - closed)

How has this been tested?

Apply this patch to simulate API error

diff --git a/src/common/chat/gitlab_chat_api.ts b/src/common/chat/gitlab_chat_api.ts
index 12c936ce..934e7ed6 100644
--- a/src/common/chat/gitlab_chat_api.ts
+++ b/src/common/chat/gitlab_chat_api.ts
@@ -82,7 +82,7 @@ export const CHAT_INPUT_TEMPLATE_17_5_AND_LATER = {
             resourceId: $resourceId
             content: $question
             currentFile: $currentFileContext
-            additionalContext: $additionalContext
+            additionallContext: $additionalContext
           }
           clientSubscriptionId: $clientSubscriptionId
           platformOrigin: $platformOrigin
before after
chat-log-before chat-log-after

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes

Merge request reports

Loading