Replace Ably with Redis Streams - #717
ianjennings with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: ianjennings <318295+ianjennings@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Ably channel/connection/message limits were being hit at scale, and WebSocket disconnects created reliability issues. This replaces Ably entirely with Redis Streams (
ioredis) for at-least-once delivery with no per-connection rate limits.Transport layer (
agent/lib/sandbox.js)_initRedis(redisUrl, streamNames)— replaces_initAbly; creates two connections (publisher + XREAD reader) with shared exponential-backoff retry strategy_startPollLoop()— singleXREAD BLOCKloop acrossresponses,files, andcontrolstreams; control starts from'0'to replay stream history, replacing Ably's channel history API for race-freerunner.readydetection_sendRedis(message, timeout)— replaces_sendAbly; publishes viaXADDto the commands stream; drops Ably-specific rate limiting (_throttledPublish) entirely_controlHandlers[]— one-shot callback array replaces Ably subscription/unsubscribe pattern forrunner.readywaitingAPI contract change
The API must now return
reply.redisinstead ofreply.ably:Dependencies (
package.json)ably ^2.6.0ioredis ^5.10.0Original prompt
ok implement this plan completely. remove ably completely
[Chronological Review: The conversation began with the user expressing concerns about hitting limits on Ably regarding channels, connections, and messages. The user then suggested using Redis as a queue to address issues with WebSocket disconnects, considering Redis Streams for at-least-once delivery. Finally, the user inquired about securely delivering Redis information to runners without exposing sensitive data.][Intent Mapping:
[Technical Inventory:
[Code Archaeology: No specific code changes or files were discussed in detail, but the conversation revolves around architectural decisions and the use of Redis.]
[Progress Assessment: The user has identified the need for a new architecture to handle message delivery and is exploring Redis as a potential solution. They are also considering security implications.]
[Context Validation: The conversation has covered the user's challenges with Ably, their exploration of Redis for message queuing, and concerns about securely delivering Redis information.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: - "we're hitting a lot of ably max channels, connections, and messages. is there a better way to architect this project to avoid those limits?" - "we previously used websockets but were facing problems with disconnects, so we wanted a queue to sit in between." - "redis seems like a good answer, but we need at-least-once delivery, so maybe streams instead?" - "can we securely deliver the redis info to the runners? how do we avoid exposing redis information?" - Session Context: The user is exploring architectural changes to address messaging limits and reliability issues in their project, particularly focusing on Redis as a solution. - User Intent Evolution: The user started with a general inquiry about architectural improvements, moved to specific technologies (Redis), and concluded with security concerns regarding data delivery.- Technical Foundation:
- Ably: A real-time messaging service with limitations on channels and connections.
- Redis: An in-memory data structure store, proposed for use as a message queue.
- Redis Streams: Suggested for at-least-once message delivery.
- Codebase Status:
- No specific files or code changes were discussed in detail.
- Problem Resolution:
- Issues Encountered: Limits on Ably channels and connections, WebSocket disconnects.
- Solutions Implemented: Exploring Redis as a potential solution for message queuing.
- Debugging Context: Ongoing discussions about the reliability of message delivery and security concerns.
- Progress Tracking:
- Completed Tasks: Identification of issues with current architecture and exploration of Redis.
- Partially Complete Work: No specific tasks have been completed yet; the user is still in the exploration phase.
- Validated Outcomes: None yet, as the user is still assessing potential solutions.
- Active Work State:
- Current Focus: Discussing the architecture for message delivery and security of Redis information.
- Recent Context: The user has been exploring Redis as a solution to their messaging issues and is concerned about securely delivering Redis information.
- Working Code: No specific code snippets were discussed recently.
- Immediate Context: The user is addressing how to securely deliver Redis information to runners.
- Recent Operations:
- Last Agent Commands: No specific commands were ex...
Created from VS Code.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.