Repository navigation
Add multiple chat sessions with titles - #116
Merged
Merged
Conversation
rdehuyss
reviewed
Nov 27, 2026
rdehuyss
reviewed
Nov 27, 2026
rdehuyss
reviewed
Nov 27, 2026
rdehuyss
reviewed
Nov 27, 2026
rdehuyss
approved these changes
Nov 27, 2026
A conversation (the web chat, a Telegram chat, a Discord channel, ...) can now have several sessions; the one that became active last is the active one. ChatSessions keeps everything about a session in its Spring AI session metadata: its conversation key, its title and when it last became active. Sessions from before keep working as their conversation's session under their old fixed id, and are tagged with their conversation the first time it changes. /new [name] in the web chat and every messaging channel starts a new session without reaching the model. After an exchange, the main model titles an untitled session in the background; after three attempts without a topic, or when the call fails, the first line of the first message is the title. Titles are unique per conversation and a title set by the user is never replaced. The web chat gets a sidebar with the chats, a search field and the other channels' conversations, and a header with the chat's title and a rename button.
Each browser tab now shows a chat session of its own. Messages and renames name the session the tab shows, and the server checks that it belongs to the web chat. A new tab opens the active session. Stream frames carry their session id and go only to the tabs that show it, so switching session, starting a new chat or opening a channel's view in the middle of an answer no longer moves the rest of it. Answers run off the WebSocket thread, so a tab can do that while one streams. Sessions from before this branch no longer exist, so the code for them is gone: legacy session ids, adopting them and their fallbacks. Task conversation keys are built from the task file's last two path segments instead of its absolute path. Model titles and titles set by a person share one cleanup, which keeps brackets that belong to the title. The title prompt asks for English.
H2 keeps microseconds and Instant.now() has nanoseconds on Linux, so the last activity read back from the session store did not equal the time the test wrote.
Rename the WebSocket handler's answers executor to concurrentChatExecutor, replace the chat tests' hand-written wait loops and fixed browser waits with Awaitility, and statically import Mockito's eq in ChatChannelTest.
Two sessions that both used tools: switching between them shows each session's own tool cards, and a reload shows them again.
arefbehboudi
force-pushed
the
feature/chat-sessions
branch
from
November 27, 2026 21:18
ae41275 to
184fb0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A conversation (the web chat, a Telegram chat, a Discord channel, ...) can now have several sessions; the one that became active last is the active one. ChatSessions keeps everything about a session in its Spring AI session metadata: its conversation key, its title and when it last became active. Sessions from before keep working as their conversation's session under their old fixed id, and are tagged with their conversation the first time it changes.
/new [name] in the web chat and every messaging channel starts a new session without reaching the model. After an exchange, the main model titles an untitled session in the background; after three attempts without a topic, or when the call fails, the first line of the first message is the title. Titles are unique per conversation and a title set by the user is never replaced.
The web chat gets a sidebar with the chats, a search field and the other channels' conversations, and a header with the chat's title and a rename button.