Skip to content

feat: persist chat history#8

Merged
kowyo merged 9 commits into
mainfrom
feat/persist-chat-history
Feb 2, 2026
Merged

feat: persist chat history#8
kowyo merged 9 commits into
mainfrom
feat/persist-chat-history

Conversation

@kowyo-bot

Copy link
Copy Markdown
Owner

Persist per-user chat history in Postgres.

What’s included:

  • New tables: chats, chat_messages (see scripts/db/migrate-chats.js)
  • New APIs: GET/POST /api/chats, GET/DELETE /api/chats/[chatId], POST /api/chats/[chatId]/messages
  • Chat UI now loads chat list + messages from DB, and sends chatId with requests
  • /api/chat now persists user + assistant messages for the current chat
  • Migration workflow runs both Better Auth + chat schema migrations (pnpm db:migrate:all)

To set up DB:

  • Run

16chats@0.1.0 db:migrate:all /home/kowyo/.openclaw/workspace/16Chats
pnpm run db:migrate && pnpm run db:migrate:chats

16chats@0.1.0 db:migrate /home/kowyo/.openclaw/workspace/16Chats
npx @better-auth/cli migrate

 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1. (or GitHub Actions → DB Migrate)

@kowyo kowyo merged commit 8a8a0e8 into main Feb 2, 2026
1 check passed
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.

2 participants