Unify Redis and Valkey store implementations in pkg/store

Open
#532 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@GuTS805 is already working on this.

Since Dec 4, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
44/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go, redis
Domain
backend, databases

Research direction

Read pkg/store/store_redis.go and pkg/store/store_valkey.go side by side, starting with loadSandboxesBySessionIDs and its pipeline behavior. Trace the shared commands, Lua script, key layout, serialization, validation, and expiry/GC logic, then compare the existing store tests for both backends. Done means one shared implementation preserves the documented environment variables and covers both Redis and Valkey behavior.

Written by the indexing model from the issue text.

Description

What would you like to be added:

Consolidate pkg/store/store_redis.go and pkg/store/store_valkey.go into a single implementation while keeping backward compatibility for existing STORE_TYPE, REDIS_*, and VALKEY_* env vars.

Two options to consider:

  • Use a single RESP-compatible client (valkey-go or go-redis/v9) for both Redis and Valkey.
  • If we still want to keep both SDKs, extract a thin low-level driver interface so key layout, serialization, validation, and expiry/GC logic live in one place.

Why is this needed:

Right now store_redis.go and store_valkey.go duplicate the same store logic and only use standard RESP commands (GET, SETNX, SET XX, DEL, ZADD, ZREM, ZRANGEBYSCORE, and the same Lua script). Every store change or bug fix has to be implemented and tested twice, and the two backends have already started drifting (e.g. pipeline GET vs MGET in loadSandboxesBySessionIDs).

Dominant language
Go
Stars
176
Forks
95
Avg merge
5d 18h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcano-sh/agentcube

All issues in volcano-sh/agentcube

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.