Skip to content

Commit 96a1084

Browse files
zhilingluoCopilot
andauthored
Update src/agentscope_runtime/engine/services/session_history/redis_session_history_service.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7d60ad4 commit 96a1084

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/agentscope_runtime/engine/services/session_history/redis_session_history_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ async def append_message(
215215
stored_session.messages = stored_session.messages[
216216
-self._max_messages_per_session :
217217
]
218+
# Keep the in-memory session in sync with the stored session
219+
session.messages = session.messages[
220+
-self._max_messages_per_session :
221+
]
218222

219223
await self._redis.set(key, self._session_to_json(stored_session))
220224

0 commit comments

Comments
 (0)