Skip to content

chore(redis): require Redis and remove the no-Redis fallbacks - #10272

Merged
waleedlatif1 merged 6 commits into
stagingfrom
chore/require-redis
Nov 21, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
chore/require-redis

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Redis is now required. The app and realtime fail fast at boot without REDIS_URL. next build still needs no Redis: pub/sub channels, MCP caches and rate-limit storage all resolve their client on first use.
  • Not-configured fallbacks removed, along with the CACHE_CAPABILITY switch that drove them:
    • Postgres token bucket and capacity store
    • Postgres OTP storage
    • In-memory pub/sub, execution signal hub, event buffers and event log
    • Memory MCP cache, base64 cache, segment-cache LRU and intent store
    • Local cancellation and abort backends
    • Realtime's in-memory room manager and disabled file-doc store
    • Null-client branches across billing, desktop, credential groups, webhooks, OAuth and mothership
  • Failure handling kept exactly as it was: the try/catch paths, fail-open/closed behavior, readyRedisClient status gates, isolated-vm undetermined, abort unknown, redis_write_failed, and the progress-marker SQL fallback. Hosted behavior is unchanged, because those not-configured branches never ran there.
  • Idempotency defaults to Redis. The flows that deliberately force database storage are untouched.
  • Setup and deploy:
    • sim-setup treats REDIS_URL as a required core key, and the cache command is gone.
    • Helm fails at render time when no REDIS_URL source reaches the app or realtime pods. Inline values, an existing Secret, External Secrets, extraEnvVars, realtime.env and envDefaults all count.
    • Compose comments, .env.example files and the self-hosting docs now say Redis is required, with eviction-policy guidance (noeviction).
    • CI provides Redis to every job that boots the app or realtime.
  • Tests and scripts:
    • The integration setup now requires a dedicated test DB index, since it flushes per file.
    • New real-Redis integration tests cover the event-log and event-buffer Lua scripts and the intent store.
    • rate_limit_bucket is marked contract-pending, to be dropped after this release ships.
    • Removed the backfill script that relied on running without Redis.

Type of Change

  • Chore / breaking change for self-hosted deployments without Redis

Testing

  • Build safety: with REDIS_URL unset, importing every module-scope rate limiter and singleton plus all app/api/**/route.ts files throws no Redis error. The same check fails on the pre-fix rate limiter.
  • type-check clean for apps/sim and apps/realtime.
  • Targeted vitest across core, execution, events, mcp, mothership, billing, desktop, webhooks and realtime (thousands of tests), plus sim-setup.
  • Helm: helm lint, helm unittest (136), and helm template over every example and CI values file.
  • Audits: check:api-validation:strict, check:unused-exports, check:test-patterns, check:utils, check:boundaries, check:client-boundary, check:deployment-config, and docs --verify-compatibility.
  • Integration suites run in CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 21, 2026 3:57am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge with the documented requirement that self-hosted installs provide Redis.

Summary

Redis becomes required for the app and realtime service.

  • The app requires Redis for its shared state and resolves the client when code first uses it.
  • App workflows use Redis instead of database and process-local fallback stores.
  • Realtime uses Redis for shared rooms and collaborative document state.
  • Setup and deployment checks require Redis for app and realtime services.

No new actionable issue was established. This review used source inspection; no tests were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[Redis configuration] --> Boot[App and realtime startup checks]
  App[App operations] --> Lazy[Client opened on first use]
  Lazy --> Redis[(Required Redis)]
  Realtime[Realtime service] --> Redis
  App --> DB[(Postgres durable records)]
  Tests[Integration setup] --> Guard[Require nonzero Redis database]
  Guard --> Reset[Clear test database per file]
Loading

Reviews (2) · Last reviewed commit: "chore(redis): drop stale fallback refere..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found and verified against the latest diff

Confidence score: 4/5

  • orphaned-runs.integration.ts can still fail during teardown when TEST_REDIS_URL is unset, even though the suite is skipped. Guard cleanup with if (redisUrl).
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/mothership/async-runs/orphaned-runs.integration.ts">

<violation number="1" location="apps/sim/lib/mothership/async-runs/orphaned-runs.integration.ts:83">
P2: The skipped suite still runs this outer teardown, but `getRedisClient()` now throws when `TEST_REDIS_URL` is absent. Guard the cleanup with `if (redisUrl)` so no-Redis test runs can skip cleanly.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
This PR changes infrastructure or deployment configuration. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

Comment thread helm/sim/templates/_helpers.tpl Resolved
Comment thread packages/sim-setup/src/modes/dev.ts Resolved
Comment thread packages/sim-setup/src/redis.ts Resolved
Comment thread packages/sim-setup/src/checks.ts Resolved
Comment thread apps/sim/.env.example Resolved
Comment thread .claude/rules/sim-testing.md Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

This branch was successfully deployed

1 active deployment
Preview — a696c09c Deployed Nov 21, 2026 by vercel[bot]
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.

1 participant