Visitar URL original
fix(core): bound event memory and persist consumer deliveries by filipeforattini · Pull Request #504 · reddb-io/redcode · GitHub
Skip to content

fix(core): bound event memory and persist consumer deliveries - #504

Draft
filipeforattini wants to merge 2 commits into
mainfrom
codex/memory-event-journal
Draft

filipeforattini wants to merge 2 commits into
mainfrom
codex/memory-event-journal

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Nov 13, 2026 •

Copy link
Copy Markdown

Problem and changes

Slow event consumers can accumulate memory without a bound. This change adds encrypted spill storage and a durable SQLite delivery journal with named consumers, acknowledgement after processing, and replay of unacknowledged deliveries. It also reduces buffering in the WebSocket transport and migrates several internal consumers.

A session waiting to retry now observes model changes through a scoped listener instead of the volatile buffer, and starts observing before it publishes the retry schedule.

Known blockers

  • The volatile spill queue can deadlock when its disk write fails and a consumer publishes recursively. Reproduce with bun run script/repro-event-buffer-disk-full.ts in packages/core. This still fails as of commit fec7609.
  • RPC, plugin event streams, and other live subscriptions remain volatile; at-least-once delivery is not guaranteed for every consumer.
  • Local typechecking fails on existing TypeScript errors involving Headers and ReadableStream. The pre-push check stalled during repository analysis and was interrupted; the branch was pushed without running that hook to completion for draft review only.

Validation

  • Session retry and transport tests: 49 passed; lint and git diff --check passed.
  • On the original base: event journal, restart, disk-full rollback, bus, MCP, providers, VCS and plugin supervisor tests passed; workerd bundle probe and migration schema check passed.
  • After rebasing onto main: plugin supervisor tests passed (8 tests). A combined test run was interrupted after concurrent checks overloaded the machine; it is not a passing full verification.

This branch has not been deployed

No deployments
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