Repository navigation
Conversation
当 expectedVersion 为 UNVERSIONED 时,所有 StateStore 实现都试图通过 getVersioned(..., State.class) 获取版本号,但 State 是接口, Jackson 无法直接反序列化接口类型,导致 InvalidDefinitionException。 修复方案: - 为每个 StateStore 实现添加私有的 readVersionOnly 方法 - 该方法直接查询版本号字段,不反序列化 state_data - 避免 Jackson 尝试将 JSON 反序列化为 State 接口 修改的实现: - JdbcAgentStateStore - MysqlAgentStateStore - PostgresAgentStateStore - RedisAgentStateStore - JedisAgentStateStore - RedissonAgentStateStore Fixes agentscope-ai#3047
补充修复 JedisAgentStateStore 和 RedissonAgentStateStore 中 saveIfVersion 方法在 expectedVersion 为 UNVERSIONED 时的反序列化问题。 Fixes agentscope-ai#3047
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.
问题描述
当
expectedVersion为UNVERSIONED时,所有AgentStateStore实现都试图通过getVersioned(userId, sessionId, key, State.class)获取版本号。但State是接口,Jackson 无法直接反序列化接口类型,导致
InvalidDefinitionException。错误堆栈:
解决方案
为每个
AgentStateStore实现添加私有的readVersionOnly方法:state_dataState接口修改的文件
JdbcAgentStateStore.javaMysqlAgentStateStore.javaPostgresAgentStateStore.javaRedisAgentStateStore.javaJedisAgentStateStore.javaRedissonAgentStateStore.java测试建议
saveIfVersion在expectedVersion = UNVERSIONED时能正确返回新版本号AgentStateStore方法不受影响关联 Issue
Fixes agentscope-ai#3047