Skip to content

fix: update Jedis guidance for Jedis 8 and RESP3 defaults - #58

Draft
ollopaci wants to merge 3 commits into
mainfrom
fix/jedis-8-resp3
Draft

ollopaci wants to merge 3 commits into
mainfrom
fix/jedis-8-resp3

Conversation

@ollopaci

@ollopaci ollopaci commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Jedis 8.0 (released 2026-08-10) removed JedisPooled, JedisSentineled and the public UnifiedJedis constructors (release notes, v7 → v8 migration guide). Every Java example in this repo used new UnifiedJedis(...) or new JedisPooled(...), so an agent following the skills wrote code that does not compile on the current Jedis release.

Separately, several client majors released this year switched to RESP3 by default, which changes reply shapes for code that parses raw replies. The skills did not mention this.

Commit 1: redis-connections and java-jedis.md

  • redis-connections: Jedis examples moved to RedisClient (7.2+). Added pool sizing via ConnectionPoolConfig. Added Lettuce imports to disambiguate its RedisClient from Jedis's.

  • Fixed the client-side caching example: RedisClient.builder()...cacheConfig(...), plus the correct redis.clients.jedis.csc.CacheConfig import (the old redis.clients.jedis.CacheConfig import does not exist) and the missing RedisProtocol import.

  • New SKILL.md section 6, "Expect RESP3 by default on current clients": the version where each client switched and how to pin RESP2.

    Client RESP3 default from
    redis-py 8.0
    node-redis 6.0
    ioredis 6.0
    Jedis 8.0
    StackExchange.Redis 3.0

    go-redis and Lettuce are left out because their docs do not state a default; the section tells agents to set the protocol explicitly for those.

  • Description extended so the skill also triggers on client upgrades to those versions (625 of 1024 characters).

  • redis-search/references/clients/java-jedis.md:

    • Client-class table updated: JedisPooled is removed, UnifiedJedis is no longer constructible, and RedisClusterClient replaces the deprecated JedisCluster.
    • Updated the migration path.
    • Changed the advice about working JedisPooled code: keep it on 7.x, replace it when upgrading to 8.0. Commit 3 adds the version detection behind this.
    • Dropped the unnecessary ((UnifiedJedis) jedis) cast on sendCommand; RedisClient inherits it.
    • Added two Jedis 8 rows to the gotchas table.

Commit 2: same fix across the other skills

This commit is mechanical and can be dropped or split out if reviewers prefer.

  • 17 redis-search references: try (UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379")) becomes try (RedisClient jedis = RedisClient.create("redis://localhost:6379")).
  • redis-clustering/references/hash-tags.md: uses RedisClusterClient, since the example is about cluster slots.
  • redis-security/references/auth.md: the TLS example moved to RedisClient.builder() with SslOptions. Jedis 8 deprecates the ssl() and sslSocketFactory() setters and enforces hostname verification by default.

Commit 3: detect the installed Jedis version first

RedisClient exists only from Jedis 7.2, and JedisPooled only up to 7.x. No single recommended class is right for every user.

  • java-jedis.md §2 now tells the agent to read the Jedis version from pom.xml, build.gradle or the lockfile before writing code. A version table gives the pooled client, the cluster client and the protocol default for each range:

    Installed Jedis Pooled client Protocol default
    8.0+ RedisClient RESP3
    7.2–7.x RedisClient or JedisPooled RESP2
    5.0–7.1 JedisPooled RESP2
  • New rules:

    • Match the installed version; don't bump the dependency unless the user asks for the upgrade.
    • New project: use the current Jedis and RedisClient.
    • Keep working JedisPooled code on 7.x.
    • Upgrading to 8.0: the swap is required. Review raw-reply parsing for RESP3 at the same time.
  • redis-connections gets the same check: one line in SKILL.md and a short version table in references/pooling.md.

  • Both skills declare the Jedis 7.2+ baseline of their Java examples in the agentskills.io compatibility frontmatter field. No other skill in this repo uses that field yet, so reviewers may want to decide whether it becomes a convention.

  • The pre-8.0 RESP2 default comes from the 8.0 changelog entry "Switch to RESP3 as default protocol version" (#4468).

Validation

  • Checked every class, factory and builder method used against Jedis master source: RedisClient extends UnifiedJedis, RedisClusterClient.create(HostAndPort), and the builder's poolConfig, cacheConfig and clientConfig. Also checked SslOptions.Builder.sslVerifyMode, csc.CacheConfig and RedisProtocol.
  • RESP3 defaults and RESP2 opt-outs checked against each client's release notes or migration guide: redis-py v8.0.0, node-redis docs/v5-to-v6.md, ioredis v6.0.0, the Jedis v7 → v8 guide, and StackExchange.Redis Resp3.html.
  • npm run validate:plugins and npm run validate:eval-baselines pass.
  • npm run validate:skill-structure with skill-validator v1.5.6 reports 0 errors. Its 2 warnings were not introduced here: redis-search deep nesting and total reference size.
  • The Java snippets were not compiled. Everything was checked against the Jedis source and redis.io docs only.

Evals

Not run. Commits 1 and 2 correct API usage against a client release. They do not change what the skills recommend: pool or multiplex, client-side caching, auth and TLS all stay the same. Commit 3 is a behaviour change: the agent now checks the installed Jedis version before choosing an API. Under CONTRIBUTING.md, that change needs evals before merge. The existing redis-connections suite does not exercise Jedis constructors. Two evals would cover the version detection: a pom.xml pinned to Jedis 6.x (expect JedisPooled, no dependency bump) and one pinned to 8.x (expect RedisClient). A further eval could check that the model writes RedisClient rather than JedisPooled when asked for a pooled Jedis client.

🤖 Generated with Claude Code

ollopaci and others added 3 commits October 26, 2026 16:18
…efaults

Jedis 8.0 removed JedisPooled, JedisSentineled and the public UnifiedJedis
constructors, so the Java examples in redis-connections no longer compiled
on the current Jedis release. Switch them to RedisClient (7.2+), add pool
sizing via ConnectionPoolConfig, and fix the client-side caching example
(RedisClient builder with cacheConfig, csc.CacheConfig and RedisProtocol
imports).

Add a section on RESP3 being the default in current client majors
(redis-py 8, node-redis 6, ioredis 6, Jedis 8, StackExchange.Redis 3),
with how to pin RESP2 in each.

Update the Jedis client-class table, migration path and version gotchas
in redis-search's java-jedis.md to match Jedis 8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces

Jedis 8.0 removed the public UnifiedJedis constructors and JedisPooled.
Swap `new UnifiedJedis("redis://...")` for `RedisClient.create(...)` in the
redis-search reference examples, use RedisClusterClient for the
redis-clustering hash-tag example, and move the redis-security TLS example
to RedisClient.builder() with SslOptions (the ssl()/sslSocketFactory()
setters are deprecated in Jedis 8, which also enforces hostname
verification by default).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RedisClient only exists from Jedis 7.2, and JedisPooled only up to 7.x,
so a single recommended class is wrong for part of the installed base.
Tell agents to read the Jedis version from pom.xml / build.gradle first,
add a version table (8.0+, 7.2-7.x, 5.0-7.1) covering pooled, cluster and
protocol defaults, and keep working JedisPooled code on 7.x unless the
task is the 8.0 upgrade. Declare the Jedis 7.2+ baseline of the Java
examples in the compatibility frontmatter of redis-connections and
redis-search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recent major releases switched the default wire protocol from RESP2 to RESP3. Reply shapes for some commands differ between the two (maps instead of flat lists, typed numbers instead of strings), so code written against RESP2 replies can break on upgrade without any change to the Redis server.

| Client | RESP3 default from | Keep RESP2 |
|---|---|---|

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lettuce supports RESP3 by default from 6.0 too

name: redis-search
description: Redis Search guidance covering FT.CREATE schema design, field type selection (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, JSON path), DIALECT 2 query syntax, FT.SEARCH / FT.AGGREGATE / FT.HYBRID command selection, vector similarity with HNSW or FLAT, hybrid retrieval combining lexical and vector ranking, RAG pipelines, zero-downtime index updates via aliases, and debugging with FT.PROFILE and FT.EXPLAIN. Use when defining a search index on Hash or JSON documents, writing FT.SEARCH queries with filters, sorting, aggregation, or vector KNN, tuning HNSW parameters, building a RAG retrieval pipeline, or troubleshooting slow or empty search results.
license: MIT
compatibility: Java examples use the Jedis 7.2+ RedisClient API; check the installed Jedis version first (see references/clients/java-jedis.md for older releases).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ideally, we should migrate this skill to use Lettuce 7.9.0 for Java examples instead of Jedis, because Jedis is a legacy client library and Lettuce provides far superior performance and compatibility.

Reference: https://redis.github.io/lettuce/user-guide/redis-search/

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.

2 participants