feat: 扩展 Session Manager 接口,新增 ListByUser、UpdateTitle 方法

- Manager.Create 签名新增 userID 参数
- 新增 ConversationSummary 类型和 ListByUser 分页查询
- 新增 UpdateTitle 方法
- MemoryManager 实现:ListByUser 遍历+过滤+排序,UpdateTitle,自动标题生成
- RedisManager 实现:user:{id}:sessions 索引,ListByUser 通过 SMEMBERS 查询
- AppendMessage 自动更新标题(首条 user 消息时,取前 20 字符)
- 更新 ws handler、api/session.go、orchestrator mock 的 Create 调用
This commit is contained in:
hhs
2026-06-14 17:35:20 +08:00
parent 9ff971fd89
commit 6487a8ecab
7 changed files with 293 additions and 38 deletions

View File

@@ -36,7 +36,7 @@ func (h *SessionHandler) CreateSession(c *gin.Context) {
cfg = *req.Config
}
sessionID, err := h.sessionMgr.Create(c.Request.Context(), cfg)
sessionID, err := h.sessionMgr.Create(c.Request.Context(), "", cfg)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"code": "INTERNAL_ERROR",