Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.

Talk to Valkey instead of Redis - #224

Merged
skearnes merged 4 commits into
mainfrom
agent/valkey
Oct 5, 2026
Merged

skearnes merged 4 commits into
mainfrom
agent/valkey

Conversation

@skearnes

@skearnes skearnes commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Production's cache moves from ElastiCache Serverless Redis OSS to Valkey (ord-infrastructure#41). This removes Redis from ord-interface: the client, the settings, the tests, and CI.

Changes

  • valkey[libvalkey] replaces redis[hiredis]. get_valkey replaces get_redis and reads VALKEY_HOST, VALKEY_PORT, and VALKEY_SSL. The natural-language cache helpers and their timeout are renamed to match.
  • Tests start a throwaway valkey-server on a free loopback port, in a temporary directory with persistence off, in place of testing.redis. The fixture pins every VALKEY_* variable to it.
  • Two new tests round-trip the natural-language cache helpers through that server and check that an unreachable server reads as a miss.
  • CI installs valkey-server from conda-forge beside rdkit-postgresql, and from apt for the app tests, in place of actions-setup-redis.
  • The README's prerequisites and local-run steps use Valkey.

Testing

  • pytest: 93 passed, against valkey-server 9.1.2 from conda-forge.
  • The tests still pass with VALKEY_SSL=1 VALKEY_HOST=203.0.113.1 VALKEY_PORT=1 in the shell, and with a corrupt dump.rdb in the repository root.
  • pre-commit hooks pass.

Notes

  • Deploy together with ord-infrastructure#41, which sets the VALKEY_* variables on the interface task: merge this first, then deploy backend and interface from Add "use as template" button or user path #41. Until the interface stack is redeployed, the running image reads its old settings.
  • A dump.rdb written by Redis 8 stops a local valkey-server --daemonize yes from starting in that directory (Can't handle RDB format version); delete it.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no outstanding findings remain.

Summary

This PR switches search-task state and natural-language caching from Redis to Valkey.

  • Updates the client, configuration, dependencies, CI, and local setup instructions.
  • Runs tests against an isolated Valkey server and adds live cache round-trip and outage coverage.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  UI[Search request] --> API[API]
  API --> DB[(PostgreSQL reaction data)]
  API --> V[(Valkey task state)]
  API --> NL[Natural-language translation]
  NL --> V
Loading

Reviews (5) · Last reviewed commit: "Drop the ping() cast and tighten the cac..."

The production cache moves to ElastiCache Serverless Valkey. The API now uses
the valkey client (with its libvalkey parser) and reads VALKEY_HOST,
VALKEY_PORT, and VALKEY_SSL. Tests start a throwaway valkey-server on a free
port instead of testing.redis, and CI installs valkey-server from conda-forge
and apt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread ord_interface/api/conftest.py Resolved
Comment thread ord_interface/api/nl_query_test.py Resolved
skearnes and others added 3 commits October 3, 2026 21:00
testing.redis takes the server binary as an argument, so it runs
valkey-server in place of the hand-rolled fixture. The fixture overrides
VALKEY_HOST and VALKEY_SSL as well as VALKEY_PORT, so a shell pointed at
another server cannot leak into the tests.

Two tests round-trip the natural-language cache helpers through the
live server and check that an unreachable one reads as a miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
testing.redis pulls in the redis client. The fixture starts
valkey-server itself on a free loopback port, in a temporary directory
with persistence off, so a dump.rdb in the working tree cannot stop it
from starting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valkey types ping() as Awaitable[Any] | Any, so the cast to
Awaitable[bool] and the comment explaining it no longer describe the
client. Three docstring lines fit in 88 columns again, and the CI step
that installs Valkey says so in its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread ord_interface/api/search.py Resolved
@skearnes

skearnes commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

@greptileai review

@skearnes
skearnes merged commit 0e44316 into main Oct 5, 2026
16 checks passed
@skearnes
skearnes deleted the agent/valkey branch October 5, 2026 00:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant