v1.0.24: Fixing the Silent ioredis Crash in Redis-Backed Agent Deployments
v1.0.24: Fixing the Silent ioredis Crash in Redis-Backed Agent Deployments
Release: v1.0.24
Type: Bug Fix
Severity: High — agents crash silently on any Redis-enabled deployment
What Happened
Sidekick's working memory module (src/lib/agent/working-memory.ts) supports Redis as a backend for persisting agent context across execute loop steps. When REDIS_URL is present in the environment, the module dynamically loads ioredis at runtime using a require('ioredis') call on line 68.
The problem: ioredis was never declared as a dependency in package.json. This meant that in any standard install (npm install), the package was absent from node_modules. As soon as any agent task triggered a working memory read or write, Node.js threw a MODULE_NOT_FOUND error and the entire agent execute loop crashed.
Who Was Affected
Any Sidekick deployment with REDIS_URL set as an environment variable. This includes:
- Self-configured deployments using Redis for session or context persistence
- Any environment where Redis was added for performance or scale reasons
Deployments without REDIS_URL configured fell through to the in-memory working memory implementation and were not affected.
What Broke
The crash surfaced in the following working memory functions, which are called throughout the agent execute loop:
| Function | Purpose |
|---|---|
getWorkingMemory | Reads the current agent working memory state |
pushToWorkingMemory | Appends a new item to working memory |
saveAgentContext | Persists full agent context to the store |
loadAgentContext | Restores agent context from the store |
Because these functions are called at nearly every step of the execute loop, any agent action — reading messages, triaging email, managing calendar events, checking repos — would fail immediately on an affected deployment.
The Fix
"ioredis": "^5.0.0" has been added to the dependencies section of package.json. Running npm install will now correctly pull in the ioredis package and make it available for the dynamic require at runtime.
No code changes were required in working-memory.ts — the runtime logic was correct; only the dependency declaration was missing.
Action Required
If you are running a self-hosted or custom Sidekick deployment with REDIS_URL configured:
- Pull the latest release (
v1.0.24). - Run
npm installto install the now-declaredioredisdependency. - Restart your agent service.
Cloud-hosted Sidekick deployments have been updated automatically.
Lessons Learned
Dynamic require() calls bypass static dependency analysis tools like depcheck and won't surface missing packages until the code path is actually executed at runtime. Going forward, all conditional dynamic imports in the codebase will be cross-referenced against package.json as part of the release checklist.