feat(agent): add redis short-term user context cache and align tests

This commit is contained in:
qzl
2026-03-06 12:02:10 +08:00
parent fb8f21bcf3
commit c5ccfc4b88
34 changed files with 2073 additions and 263 deletions
+3 -1
View File
@@ -33,7 +33,9 @@ class AgentRepository:
except ValueError as exc:
raise HTTPException(status_code=422, detail="Invalid user_id") from exc
session = AgentChatSession(user_id=user_uuid)
session = AgentChatSession(
user_id=user_uuid,
)
self._session.add(session)
await self._session.flush()
await self._session.refresh(session)