Repository navigation
feat(database-redis): add Redis adapter and persistent Redis state - #1292
Merged
Merged
Conversation
Split from #1281, keeping only the Redis feature: - packages/database-redis: history adapter backed by ioredis. - bot: RedisState backend selected through GeneralArgs.RedisOptions; BotState reads are Promise-returning so an external backend fits the contract. - manager: no changes here; the async contract is additive for in-memory state. - cli/zones/starters: redis database option plus regenerated templates using `await state.get(...)`. - root workspaces: packages/database-redis added, which check:workspace-deps needs to see the package at all. Out of scope (kept for a separate unit): handleMsg fallback rewrite, addAnswer ref change, BUILDERBOT_SILENT and the generator CRLF normalization.
This was referenced Nov 18, 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.
Que tipo de Pull Request es?
Descripción
Redis adapter and persistent state, split out of #1281 so the Redis feature can be reviewed without the unrelated core-pipeline rewrite.
This is unit A of two. Unit B —
handleMsgfallback rewrite,addAnswerref change,BUILDERBOT_SILENTand the generator CRLF normalization — is deliberately not included here.Cambios
packages/database-redis/**ioredis(keysbot:history:<prefix>:<from>, TTL renewed per message,SCAN-basedclearAll)packages/bot/src/context/redisStateClass.tsRedisStatebackend:multi().hset()+ conditionalexpire, atomic, no GET/SET racepackages/bot/src/types.tsGeneralArgs.RedisOptions;BotStatereads returnPromiseso an external backend fits the contractpackages/bot/src/core/coreClass.tsRedisState,stateHandler: SingleState | RedisState, constructor picks the backend fromRedisOptions,awaitat the two state reads,as BotStateStandAlonecast, awaits inendFlowpackages/cli/src/configuration/index.tsredisadded to the database listscripts/generate/**await state.get(...)starters/apps/**lerna.json, rootpackage.jsonpackages/database-redisadded to rootworkspacespnpm-lock.yamlioredis@5.11.1, no registry snapshot of@builderbot/botPor qué el
workspacesraíz importapackages/database-rediswas already inlerna.jsonbut missing from rootpackage.jsonworkspaces, which is the only input ofscripts/check-workspace-deps.js. Without that entry the guard was blind to the package. It is added here.Verificación ejecutada
pnpm test, 30 projects)packages/botredisState)packages/database-redispnpm run generate:check@builderbot/botbuild@builderbot/database-redisbuildioredis@5.11.1resolved; zero@builderbot/botregistry snapshotsContrato async: qué cambia para terceros
BotState.get/getMyState/getAllState/clearnow declarePromise. With the in-memory backend the values still arrive immediately, soawaitworks and existing runtime behaviour is unchanged; the difference is that TypeScript now requiresawaitat call sites. The generated templates were updated accordingly. This is a public typing change, which is why it is called out instead of hidden inside a dependency bump.Fuera de alcance
handleMsgfallback rewrite,addAnswerrefchange,BUILDERBOT_SILENT, generator CRLF normalization and their tests (0.2.5-handlemsg-fallbacks, hunks ofcoreClass.test/events.test/0.0.1-flow-events). Those go to unit B.Checklist
generate:checkexecuted on this treeTestsandTemplates in sync(includingCheck generated templates) both passed