feat: Redis multi-container support (Phase 1.6)#28
Merged
Conversation
Redis-backed conversation store and distributed rate-limit counters so sessions and limits are shared across instances behind a load balancer, opt-in via .AddBotWireRedis(connString) after AddBotWire(). Defaults are unchanged: without it, the in-memory stores and per-process counters are used exactly as before. - IRateLimitStore abstraction in BotWire.Core (no StackExchange.Redis dep) - RedisConversationStore: JSON sessions, sliding SessionTtl, dual-history round-trip, MaxHistoryMessages cap enforced like the in-memory store - RedisRateLimitStore: atomic INCRBY + conditional EXPIRE (Lua), TTL clamped >=1s so day-boundary token-budget keys are not deleted - RateLimiter: async variants use the store when present; per-minute path waits for the fixed window to roll instead of admitting over-quota turns - RedisShop sample: ASP.NET API (Redis sessions + distributed limits + email escalation) and a Vite/React/TS shopfront on headless botwire-js - v0.3.0 release notes; README Samples section Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BotWire.Redis shipped with no PackageReadmeFile, so its NuGet listing would have no description. Add a package-specific NUGET.md, wire it into the csproj, and list the package in the shared root NUGET.md table. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1.6 makes BotWire correct behind a load balancer. New opt-in
BotWire.Redispackage moves conversation sessions and rate-limit counters out of process memory into Redis, so they're shared across instances and survive restarts. Defaults are unchanged — without.AddBotWireRedis(...)everything behaves exactly as v0.2.0.What's included
IRateLimitStoreabstraction inBotWire.Core— no StackExchange.Redis dependency in Core.RedisConversationStore— JSON sessions, slidingSessionTtl, dual-history round-trip,MaxHistoryMessagescap enforced identically to the in-memory store.RedisRateLimitStore— atomic INCRBY + conditional EXPIRE (Lua); TTL clamped ≥1s so day-boundary token-budget keys aren't deleted.RateLimiterasync variants use the store when present; per-minute path waits for the fixed window to roll rather than admitting over-quota turns.MaxConcurrentSessionsstays per-container by design.RedisShopsample — ASP.NET API (Redis sessions + distributed limits + email escalation) + Vite/React/TS shopfront with a custom chatbox on headlessbotwire-js.Testing
Notes
/code-review highwere fixed in this branch (per-minute enforcement, history-cap parity, TTL clamp) with regression tests.VersionPrefixleft at 0.2.0 — version bump +v0.3.0tag is the separate release cut.🤖 Generated with Claude Code