Skip to content

Conversation

tsmithsz
Copy link
Contributor

@tsmithsz tsmithsz commented Sep 9, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

JetBrains inline chat generates code successfully but users cannot see the results due to a 400 validation error when sending telemetry events. The backend rejects telemetry with empty conversationId field, returning:

com.amazon.coral.validate.ValidationException: 1 validation error detected: Value at telemetryEvent.chatAddMessageEvent.conversationId failed to satisfy constraint: Member must have length greater than or equal to 1

From the JB logs:

Request from tab: 3703d901-dadd-4e80-8e9d-222557105bc6, conversationId: null
Response to tab: 3703d901-dadd-4e80-8e9d-222557105bc6, conversationId: 

The API returns an empty string for conversationId in inline chat scenarios, which gets stored and later causes telemetry validation failures.

Flow:

  • JetBrains creates new inline chat tab → conversationId = null

  • API call made → API returns empty string conversationId: ""

  • ChatSessionV1 stores empty string → conversationId = it.conversationId()

  • TelemetryHelper retrieves empty string → getConversationId(tabId) returns ""

  • Backend rejects telemetry → 400 error

Solution

Generate a UUID when the API returns null or empty conversationId. This ensures telemetry always has a valid conversationId.

Testing

Testing was conducted in sandbox and was not able to reproduce issue. From logs in Sandbox:

2025-09-09 14:44:22,582 [ 181075]   INFO - software.aws.toolkits.jetbrains.services.cwc.clients.chat.v1.ChatSessionV1 - Request from tab: 31e9a81e-e5fa-4aab-8fc7-eeefb8188b15, conversationId: null, request: GenerateAssistantResponseRequest(ConversationState=ConversationState(CurrentMessage=ChatMessage(UserInputMessage=UserInputMessage(Content=*** Sensitive Data Redacted ***, UserInputMessageContext=UserInputMessageContext(EditorState=EditorState(Document=TextDocument(RelativeFilePath=*** Sensitive Data Redacted ***, ProgrammingLanguage=ProgrammingLanguage(LanguageName=python), Text=*** Sensitive Data Redacted ***, DocumentSymbols=[]), CursorState=CursorState(Range=Range(Start=Position(Line=13, Character=8), End=Position(Line=18, Character=19))), RelevantDocuments=[], UseRelevantDocuments=false, WorkspaceFolders=*** Sensitive Data Redacted ***)))), ChatTriggerType=INLINE_CHAT, CustomizationArn=arn:aws:codewhisperer:us-east-1:011528293760:customization/XMAXDH7RXN44), ProfileArn=arn:aws:codewhisperer:us-east-1:724904587780:profile/KGGD9MM7EMNX)
2025-09-09 14:44:24,846 [ 183339]   INFO - software.aws.toolkits.jetbrains.services.cwc.clients.chat.v1.ChatSessionV1 - Response to tab: 31e9a81e-e5fa-4aab-8fc7-eeefb8188b15, conversationId: aaa78bb9-07af-4ecc-993e-2ed14384e1a6, requestId: 9ddb092a-9495-4668-b504-0b24d1948269, metadata: AwsResponseMetadata(metadata=[AWS_REQUEST_ID, x-amzn-RequestId, :content-type, :event-type, :message-type])

We can see that a random UUID was generated

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tsmithsz tsmithsz changed the title fix(amazonq): Fix JetBrains inline chat 400 error due to empty conver… fix(amazonq): Fix empty conversationId in telemetry Sep 9, 2025
Copy link

github-actions bot commented Sep 9, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@tsmithsz tsmithsz enabled auto-merge (squash) September 9, 2025 23:27
@tsmithsz tsmithsz disabled auto-merge September 9, 2025 23:49
@tsmithsz tsmithsz merged commit ccec284 into main Sep 9, 2025
22 of 24 checks passed
@tsmithsz tsmithsz deleted the fix-inline branch September 9, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants