[FIX] Bump tool versions for Redis Sentinel compatibility#1859
Conversation
Patch bump for tools that depend on unstract-core's updated Redis client with Sentinel support: - classifier: 0.0.76 -> 0.0.77 - structure: 0.0.97 -> 0.0.98 - text_extractor: 0.0.72 -> 0.0.73 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review Summary by CodeRabbit
WalkthroughThis pull request adds Redis Sentinel support through new environment variables and refactors Redis client initialization to use a factory pattern. It bumps versions for classifier (0.0.76→0.0.77), structure (0.0.97→0.0.98), and text_extractor (0.0.72→0.0.73) tools. It also introduces the core package as an editable dependency across tools and SDK components. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test ResultsSummary
Runner Tests - Full Report
SDK1 Tests - Full Report
|
|
|
Not waiting for approvals on this PR since its a trivial version bump and due to urgency |
73b8216
into
refactor/redis-client-creation-dry
Greptile SummaryThis PR does two things under one patch-version bump: (1) it increments the versions of three tool containers ( Key changes:
Issue found: In Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Runner as Runner / ToolsUtils
participant Factory as create_redis_client()
participant Env as Environment Variables
participant Sentinel as Redis Sentinel
participant Master as Redis Master
Runner->>Env: read REDIS_SENTINEL_MODE, REDIS_SENTINEL_MASTER_NAME
Runner->>Runner: inject into tool/sidecar container env
note over Runner: New in this PR ↑
Runner->>Factory: create_redis_client(env_prefix, db, ...)
Factory->>Env: _resolve_redis_env() → host, port, password, ssl
alt SENTINEL_MODE == true
Factory->>Sentinel: Sentinel([(host, port)], sentinel_kwargs)
note over Factory,Sentinel: ⚠️ ssl missing from sentinel_kwargs
Sentinel-->>Factory: SentinelConnectionPool
Factory->>Master: sentinel.master_for(master_name, **master_kwargs)
Master-->>Factory: redis.Redis (Sentinel-backed)
else standalone
Factory->>Master: redis.Redis(host, port, **kwargs)
Master-->>Factory: redis.Redis (direct)
end
Factory-->>Runner: redis.Redis client
note over Runner: MetricsMixin also calls create_redis_client(db=1)
|
* [FIX] Fix Redis Sentinel crash in MetricsMixin (prompt-service)
MetricsMixin was creating a raw StrictRedis client using REDIS_HOST/PORT
directly, which in Sentinel HA mode points to the Sentinel process (port
26379). Sentinel doesn't support the SELECT command, causing
ResponseError on every /answer-prompt call.
- Replace StrictRedis with create_redis_client() from unstract-core
which handles Sentinel discovery via master_for()
- Add unstract-core as sdk1 dependency (all services using sdk1 already
depend on core, so zero new transitive deps)
- Add error handling around set_start_time() and collect_metrics() so
Redis failures degrade gracefully instead of crashing requests
- Add missing COPY for unstract/core in tool Dockerfiles (classifier,
structure, text_extractor) since sdk1 now depends on core
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Commit uv.lock changes
* [FIX] Add unstract-core to tool requirements.txt for pip resolution
Tool Dockerfiles (classifier, text_extractor, structure) use pip, not
uv. Since sdk1 now depends on unstract-core (which isn't on PyPI),
pip can't resolve it via [tool.uv.sources]. Adding explicit editable
install of core before sdk1 ensures pip finds it locally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [REFACTOR] DRY Redis client creation in worker cache modules
Worker cache modules (cache_backends.py, cache_utils.py) duplicated
sentinel/standalone branching logic for Redis client creation. Both
now use create_redis_client() from unstract-core as the single entry
point, which already handles mode detection internally.
- Add SSL support (ssl, ssl_cert_reqs) to create_redis_client() via
env vars ({prefix}SSL, {prefix}SSL_CERT_REQS), disabled by default
- Remove if-sentinel-else-standalone branching in cache_backends.py
and cache_utils.py — replaced with single create_redis_client() call
- Remove unused os and redis imports from simplified modules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [FIX] Pass Redis Sentinel env vars to tool and sidecar containers
The runner was not forwarding REDIS_SENTINEL_MODE and
REDIS_SENTINEL_MASTER_NAME to tool containers and sidecars, causing the
sidecar to connect in standalone mode to the Sentinel port (26379) and
fail on all data commands (HGETALL, SETEX).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [FIX] Bump tool versions for Redis Sentinel compatibility (#1859)
Patch bump for tools that depend on unstract-core's updated
Redis client with Sentinel support:
- classifier: 0.0.76 -> 0.0.77
- structure: 0.0.97 -> 0.0.98
- text_extractor: 0.0.72 -> 0.0.73
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>



What
0.0.76→0.0.770.0.97→0.0.980.0.72→0.0.73Why
unstract-corewhich was updated with Redis Sentinel support (create_redis_client()factory). The version bump ensures new tool container images are built with the updated dependency, enabling proper Sentinel-aware Redis connections (e.g., MetricsMixin).How
toolVersionin each tool'sproperties.jsonpublic_tools.jsonregistry with new versions and image tagsbackend/sample.envwith new structure tool versionCan this PR break any existing features. If yes, please list possible items. If no, please explain why.
unstract-coredependency gains Sentinel support.Database Migrations
Env Config
STRUCTURE_TOOL_IMAGE_TAGupdated to0.0.98insample.envRelevant Docs
Related Issues or PRs
Dependencies Versions
Notes on Testing
Checklist
I have read and understood the Contribution Guidelines.