Skip to content

fix(redis): add Redis Cluster support for AgentStateStore - #2587

Open
amyaxy wants to merge 4 commits into
agentscope-ai:mainfrom
amyaxy:fix/2579_agentStateStore-support-for-redis-cluster
Open

fix(redis): add Redis Cluster support for AgentStateStore#2587
amyaxy wants to merge 4 commits into
agentscope-ai:mainfrom
amyaxy:fix/2579_agentStateStore-support-for-redis-cluster

Conversation

@amyaxy

@amyaxy amyaxy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

close #2579

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

…ore (agentscope-ai#2579)  - Bind session/namespace keys to the same slot via hash tags to avoid   CROSSSLOT errors on multi-key EVAL in cluster mode - Fix cross-node SCAN for Jedis (scanIteration) and Lettuce (iterate all   master nodes) so listSessionIds/clearAllSessions no longer miss shards - Escape glob metacharacters in listSessionIds userId - Document key-layout breaking change in class Javadoc - Make the integration test portable (single container + fixed port   bindings) so it runs on Windows/macOS/Linux - Add testcontainers dependency; add unit + integration tests (22 cases pass)
@amyaxy amyaxy changed the title fix(redis): add Redis Cluster support for AgentStateStore and RedisSt… fix(redis): add Redis Cluster support for AgentStateStore Aug 6, 2026
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/extensions/redis/state/RedisAgentStateStore.java 81.81% 3 Missing and 1 partial ⚠️
...ions/redis/state/lettuce/LettuceClientAdapter.java 84.61% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR modifies 12 files with 1160 lines of diff.

Observations

  • Files changed: 12
  • Test coverage: ✅ Tests included
  • CLA: ✅ Signed

Suggestions

  • Please ensure all public API changes are backward compatible
  • Consider adding unit tests for new logic paths

Automated review by github-manager-bot

@amyaxy

amyaxy commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@zouyx 麻烦审核一下,谢谢

client.deleteKeys(keys.toArray(new String[0]));
// Delete keys one by one to avoid CROSSSLOT errors
// in Redis Cluster mode where keys span multiple slots.
for (String key : keys) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里批量操作时,可能和 save 方法造成竞态

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agentStateStore does not support Redis Cluster.

3 participants