Skip to content

Conversation

@scezen
Copy link
Member

@scezen scezen commented Nov 21, 2025

Ticket : DERCBOT-1727

Details

  • Added support for an introductory message automatically sent for the first message of a space/thread.
  • Introduced a configurable cooldown (default aligned with dialog validity: 24h) to prevent spam.
  • Updated send() flow to dispatch the intro message before the bot’s actual reply when the cooldown allows it.
  • Added a new connector parameter introMessage and exposed it in the connector configuration UI.

@scezen scezen force-pushed the feature/googlechat-intro-message/DERCBOT-1708 branch from 688b1e7 to 1e40b41 Compare November 21, 2025 16:48
@scezen scezen marked this pull request as ready for review December 3, 2025 08:07
@scezen scezen force-pushed the feature/googlechat-intro-message/DERCBOT-1708 branch from 449bf80 to 1e40b41 Compare December 3, 2025 10:02
@scezen scezen force-pushed the feature/googlechat-intro-message/DERCBOT-1708 branch from 449bf80 to 27c5a7e Compare December 3, 2025 15:02
private val introCooldownSeconds: Long = longProperty("tock_bot_dialog_max_validity_in_seconds", 60 * 60 * 24)

// Last intro send time per space + thread
private val introSentThreads: MutableMap<String, Long> = mutableMapOf()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High risk of memory leak here, the state stored here will not be shared across all chat-api nodes.

As discussed yesterday we need to communicate data from the ConnectorController to the Connector. Why ? Because the ConnectorController load the UserTimeline and we can rely on it as it contains a list of dialogs to have the associated Google Chat thread conversation history.

Currently we have ConnectorData to send data from the connector to the ConnectorController, when the ConnectorController needs to communicate with the Connector it uses each connector callback implementation of ConnectorCallbackBase, in our case GoogleChatConnectorCallback. Callback is used to communicated different stuff during the Action lifecycle treatment, in our case we want to tell the GoogleChatConnectorCallback connector when the UseTimeline is loaded with it so that it can extract if it's en empty / first dialog or not and the send the intro message.

Add to ConnectorCallbackBase a new method called something like initialUserTimelineLoaded, call it from the controller. In GoogleChatConnectorCallback send the intro message in this method if the dialog is empty.

3600,
null,
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have red that in the other pull request, rebase it plz.

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.

2 participants