fix(storage): 优化 SQL 存储兼容性#60
Merged
Merged
Conversation
Contributor
raychen911
commented
May 11, 2026
- 新增通用的 Content 清理逻辑,在 SQL Session 和 Memory 存储读写时过滤空的 Content Part。
- 修复 MySQL 下 DynamicPickleType 写入 LONGBLOB 时未序列化导致的类型错误。
- 支持通过 sessionmaker_kwargs 向 SqlStorage 传递 sessionmaker 配置,例如 expire_on_commit。
- 将 SQL Session 中显式更新 update_time 的逻辑改为使用 datetime.now(),避免 func.now() 带来的 ORM 状态问题。
- 统一通过当前事件循环创建 Session 和 Memory 服务的清理任务。
- 优化 SQL Session 示例输出,在助手回复前打印用户问题。
- 在 SQL Memory/Session 示例中关闭 thinking 输出,使演示结果更清晰。
- 增加 SQL Content 清理和 MySQL DynamicPickleType 序列化相关测试。
9e0117b to
d288007
Compare
weimch
reviewed
May 12, 2026
|
|
||
| self.__cleanup_stop_event = asyncio.Event() | ||
| self.__cleanup_task = asyncio.create_task(self._cleanup_loop()) | ||
| self.__cleanup_task = asyncio.get_event_loop().create_task(self._cleanup_loop()) |
Contributor
Author
There was a problem hiding this comment.
如果协程没启动,使用asyncio.create_task会报错,换成这个asyncio.get_event_loop就不会报错,这个是是构建协程任务投递,在初始化的时候调用,此时协程还没有运行
weimch
reviewed
May 12, 2026
| ) | ||
| if event.content: | ||
| storage_event.content = event.content.model_dump(exclude_none=True, mode="json") | ||
| storage_event.content = sanitize_content_json(event.content.model_dump(exclude_none=True, mode="json")) |
Contributor
Author
There was a problem hiding this comment.
当出现error的时候这个Content为空会导致校验失败
d288007 to
7f9d4af
Compare
- 新增通用的 Content 清理逻辑,在 SQL Session 和 Memory 存储读写时过滤空的 Content Part。 - 修复 MySQL 下 DynamicPickleType 写入 LONGBLOB 时未序列化导致的类型错误。 - 支持通过 sessionmaker_kwargs 向 SqlStorage 传递 sessionmaker 配置,例如 expire_on_commit。 - 将 SQL Session 中显式更新 update_time 的逻辑改为使用 datetime.now(),避免 func.now() 带来的 ORM 状态问题。 - 统一通过当前事件循环创建 Session 和 Memory 服务的清理任务。 - 优化 SQL Session 示例输出,在助手回复前打印用户问题。 - 在 SQL Memory/Session 示例中关闭 thinking 输出,使演示结果更清晰。 - 增加 SQL Content 清理和 MySQL DynamicPickleType 序列化相关测试。
7f9d4af to
d10f04c
Compare
weimch
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.