Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Chat Bot Doesn’t Respond in Thread for First Message but Works for Subsequent Messages

Hi!
I’m building a Google Chat bot that should respond in the same thread where it is mentioned.
I use google chat api and pass data to google cloud function via webhook. Unfortunately the response doesn't always go to the right thread.

However, the bot behaves differently depending on the context:

First Message in a Thread: If the bot is tagged in the first message of a thread, it responds as a new message in the space, not within the thread.
Subsequent Messages in the Thread: If the bot is tagged in the second or later messages of the same thread, it replies correctly within that thread.

Current Implementation: Here’s the response structure I’m returning in my bot code:

 

 

 

{
  "text": assistant_response,
  "thread": {
    "name": google_thread_name
  }
}

 

 

 


The google_thread_name value is directly taken from the event data, and it has the correct format: spaces/{space_id}/threads/{thread_id}
Despite this, the bot does not respond in the thread for the first message. Any insights on what might be going wrong or how to fix this behavior? Thank you!

1 1 396
1 REPLY 1

Same problem here, did find any solution?