Files
Aska 37e98ec584
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled
feat: IM平台列 + deviceID标识 + 会话持久化完善
- agent-96: chat_messages 加 platform 列(迁移0004) + IM主人私聊落主会话web(带platform) + 前端按平台过滤契约 + message_persisted 带 platform(复用 BroadcastPersisted)
- agent-97: chat_messages 加 device_id 列(迁移0005) + history.Message.DeviceID + Web发消息带deviceId(localStorage getClientId) + IM persistToMain 带 deviceID + 前端气泡展示 SourceLabel + 修主会话基础2个bug(fn scanMessage语法/DDL缺列)
- design/16 §4.4(平台) + §4.5(deviceID) 已入档
- 实机: POST /chat 带 deviceId 读回 user/assistant 均带 deviceId+platform; 后端 build/vet/test 绿 + 前端 build 绿
- 红线: 身份靠 actor 元数据; 禁止 shell 读 .env(JWT冒烟由主会话跑)
2026-09-07 04:51:41 +08:00

11 lines
610 B
SQL

-- 0005_chat_device: tag every chat message with a short deviceID/client identifier
-- (DevDocs/design/16 §4.5). deviceID is the concrete client (browser/app/IM channel
-- binding) that produced the message, complementing `platform` which only names
-- the platform. It lets the agent know exactly HOW the owner is chatting (e.g.
-- "web:chrome:a1b2c3" for a browser, "weixin-ilink:conf0:wx_uid_123" for IM).
--
-- The 0004 chat_messages table already exists at this point, so ALTER ADD COLUMN is
-- the correct, non-destructive step.
ALTER TABLE chat_messages ADD COLUMN device_id TEXT NOT NULL DEFAULT '';