OpalChatSessions

The OPAL chat over the session store of libllmsession (trove-parts §TPN-9, TPX-41, TPX-42, TPX-45).

Inherits QObject
Group libopal

Declared in src/libs/libopal/opal/OpalChatSessions.hpp.

Detailed description

Before trove-parts, the OPAL chat had a store of its own, opal-conversations.db, with conversations, messages and the rows of the chat. That store is retired. A chat is now an assistant session in sessions.db, the one store of the sessions part (§TPN-3):

What the chat keeps Where it is now
The conversation id The session id
The title The record's title
The model The record's model
The retention policy (24 h by default) The record's retention. forever is keep, and delete is close: the session goes when the chat leaves it (release())
The CLI session id (cli_session_id) The record's provider_session
A message of the user A prompt event, role user
A "[System: …]" note to the model A system event, role user
A reply of the model A text event, role assistant, then turn_end
A failed turn An error event, then turn_end
A new provider session A system event, role provider
The rows that the chat shows system events, role view
The attachments A system event, role attachments
The context of a Trove chat A system event, role context

Events are never changed or removed one by one. A row of the chat that changes (a plan step that ends, an approval) is written again as a new view event, and loadView() keeps the last one of each row. A removed row writes a view event that cuts the rows from that index.

A block of the chat, {mime, data}, becomes an event block {"type":"text","mime":…,"text":…}, or {"type":"image","mime":…,"path":…} for a picture. A reader that knows only the event types of §TPN-3, for example the Trove lane view, reads the text of every block.

No data moves from opal-conversations.db (owner rule: one user, no backward compatibility).

See also octomy::llmsession::SessionStore, OpalChatViewLog, OpalConversationDriver.

In this section