From 1ae80d3a15db45e166c7a92eaf1bdbed29cddd01 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 4 Nov 2026 13:35:18 +0000 Subject: [PATCH] feat(connectors): add /new to start a fresh chat from the app A connection kept one chat per person for good, with no way to ask for a new one. A person can now send /new (or !new, for Slack, which keeps messages that begin with a slash for itself) as the whole message. The host reads the command after the pairing check and before any model turn, so the agent never sees it and the logs record only the ids. It drops the link from the person, or from the shared thread or group, to its chat. The old chat stays in Studio. The link is in the shared store, so it works with several frontends and for every connector add-on. In the chat mode and in a thread of a group, everyone shares the chat, so only a paired sender may reset it. The thread mode answers that every message already starts a new chat. A chat with a running turn is left alone and the sender is asked to repeat the command later. Telegram did not treat /new@BotName as addressed to the bot in a group; it does now, and keeps the text. The connection page gets one help line under Conversations. Assisted-by: Claude:claude-sonnet-5-5 --- .../connector-ui/src/AnswerFields.jsx | 3 +- addons/telegram/transport/botapi.go | 13 +- addons/telegram/transport/botapi_test.go | 20 ++ core/http/react-ui/e2e/telegram-addon.spec.js | 1 + core/services/studio/connectornew.go | 75 ++++++ .../studio/connectornew_internal_test.go | 39 +++ core/services/studio/connectors.go | 5 + .../studio/connectors/connectorstest/suite.go | 19 ++ core/services/studio/connectors/gorm.go | 4 + core/services/studio/connectors/json.go | 11 + core/services/studio/connectors/types.go | 4 + core/services/studio/connectors_new_test.go | 246 ++++++++++++++++++ docs/content/features/chats-connectors.md | 30 +++ 13 files changed, 468 insertions(+), 2 deletions(-) create mode 100644 core/services/studio/connectornew.go create mode 100644 core/services/studio/connectornew_internal_test.go create mode 100644 core/services/studio/connectors_new_test.go diff --git a/addons/internal/connector-ui/src/AnswerFields.jsx b/addons/internal/connector-ui/src/AnswerFields.jsx index 7c55b6640f..e67618362a 100644 --- a/addons/internal/connector-ui/src/AnswerFields.jsx +++ b/addons/internal/connector-ui/src/AnswerFields.jsx @@ -19,6 +19,7 @@ export const ANSWER_TEXT = { 'answer.reply.stream': 'Live: the answer as it is written', 'answer.replyHelp': 'Progress and Live show one working message, and the answer replaces it. On a platform with drafts, Live shows a private chat a draft instead, and the answer follows it. A long answer goes on in new messages.', 'answer.conversationLabel': 'Conversations', + 'answer.conversationHelp': 'Send /new (or !new) in the app to start a new chat.', 'answer.conversation.sender': 'One chat per person', 'answer.conversation.chat': 'One chat per group or channel', 'answer.conversation.window': 'Per person, new after a quiet time', @@ -75,7 +76,7 @@ export default function AnswerFields({ form, setForm, t, kindInfo }) { )} - + {(p) => (