Skip to content

Restart the conversation on the server side when the messages are cleared - #219

Open
zigzago wants to merge 1 commit into
masterfrom
feat/restart-conversation
Open

zigzago wants to merge 1 commit into
masterfrom
feat/restart-conversation

Conversation

@zigzago

@zigzago zigzago commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up of theopenconversationkit/tock#2164 (issue theopenconversationkit/tock#2021).

Problem

The clear messages button only erases the messages on the client side. The bot keeps the whole conversation context (current story and intent, entity values, RAG history).

Change

A new restartKeyword setting in TockSettings, undefined by default. When it is set (_restart_ with the default Tock configuration, property tock_bot_restart_keyword), the clear messages button:

  • clears the messages and the quick replies, as before;
  • sends the keyword to the bot without displaying it. The bot starts a new dialog and keeps the user (same user id, analytics, consents), then answers with its conversation restarted label, which is displayed.

The same behaviour is exposed by the new restartConversation method of useTock. clearMessages is unchanged, so an afterInit callback that calls it does not send anything.

The setting is opt-in: a Tock backend without #2164 would handle _restart_ as a regular sentence.

Docs: restartKeyword in the TockSettings table of the README.

Checked with tsc --noEmit, yarn build, eslint and prettier (no tests in this repository).

…re cleared

A new restartKeyword setting (undefined by default). When it is set (to _restart_
for the default Tock configuration), the clear messages button also sends this
keyword to the bot, without displaying it, so that the bot starts a new dialog
while keeping the user. The restartConversation method of useTock does the same.
@zigzago

zigzago commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@Fabilin please review this PR ;)

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.

1 participant