fix(conversation): 离屏不丢回复、列表预热 WS 与非阻塞进入聊天

- 后端:文本/转写后 AI 生成改为独立任务,避免断连取消整轮;按需 TTS 等与 WS 改动
- 前端:RealtimeSession 重绑 UI 时恢复流式 buffer;列表 onPressIn/挂载预热、已有会话立即 push
- 同步会话相关类型、i18n、测试与 env/资源等累计改动

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin
2026-05-08 17:28:31 +08:00
parent 5dac3efd52
commit d0c26242db
44 changed files with 1209 additions and 212 deletions

View File

@@ -46,14 +46,9 @@ class UserService:
user = await repo.get_user_by_id(user_id, self._db)
if not user:
raise ValueError("用户不存在")
if body.birth_year is not None:
user.birth_year = body.birth_year
if body.birth_place is not None:
user.birth_place = body.birth_place
if body.grew_up_place is not None:
user.grew_up_place = body.grew_up_place
if body.occupation is not None:
user.occupation = body.occupation
for field in ("birth_year", "birth_place", "grew_up_place", "occupation"):
if field in body.model_fields_set:
setattr(user, field, getattr(body, field))
await self._db.commit()
await self._db.refresh(user)
return _user_to_profile(user)