feat(gateway): persist chat sessions and messages in PostgreSQL
- store: new chat_sessions/chat_messages tables with CRUD, ILIKE message search, and auto-titling from the first user message - context: optional Persister on the sliding-window store — messages are saved asynchronously on Add, sessions not in memory are restored from the database on Get - orchestrator: ProcessInput/FinishRound now carry userID so persisted messages have an owner - api: real session handlers (list/create/delete), message history and clear endpoints, working message search and three-format export (markdown/txt/json), fixing the short-ID panic in export - main: migration, store wiring, ctxStore persister adapter Tests: chat store handler lifecycle (fake store), context persister save/restore, stub auth login flow updated.
This commit is contained in:
1 parent
f44bf26050
commit
f8196c111c
11 files changed
+787
-27
No files matched your search
@@ -25,7 +25,7 @@ func TestHealth(t *testing.T) {
|
||||
|
||||
func TestLoginAndProtectedEndpoint(t *testing.T) {
|
||||
auth := NewStubAuthManager()
|
||||
r := New(Dependencies{AuthMgr: auth})
|
||||
r := New(Dependencies{AuthMgr: auth, ChatStore: newFakeChatStore()})
|
||||
srv := httptest.NewServer(r)
|
||||
defer srv.Close()
|
||||
|
||||
|
||||
Reference in new issue
Block a user