sse-resilience

Manage SSE streams with Redis-backed persistence, heartbeat monitoring, and cleanup.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill sse-resilience
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sse-resilience
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/sse-resilience
Command: npx skills add https://github.com/dadbodgeoff/drift --skill sse-resilience

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the unreliability of Server-Sent Events (SSE) streams, preventing silent failures, lost completion events, and resource leaks.

Core Features & Use Cases

  • Stream Management: Tracks active SSE streams using Redis.
  • Heartbeat Monitoring: Detects and handles disconnected clients.
  • Completion Recovery: Stores terminal events for client-side recovery.
  • Automatic Cleanup: A background guardian process purges orphaned streams.
  • Use Case: Ensure that users always receive the final output of a long-running generation process, even if their connection drops and reconnects.

Quick Start

Use the sse-resilience skill to ensure that SSE streams are robust against disconnections and data loss.

Frequently Asked Questions about sse-resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover lost completion events in SSE streams after a client disconnects?

SSE stream recovery stores terminal events in Redis, allowing clients to retrieve the final output of a long-running generation process upon reconnection. This prevents lost completion events when connections drop unexpectedly.

Why do my Server-Sent Events streams fail silently without triggering error handlers?

Silent SSE stream failures occur when disconnected clients go undetected. Heartbeat monitoring uses Redis to track active streams and detect dead connections, preventing silent failures and ensuring broken streams are properly handled.

Do I need Redis to manage SSE stream state and background cleanup?

Yes, Redis is required for SSE stream management. It stores the stream registry, completion events, and stream state, while a background guardian process uses this data to purge orphaned streams and prevent resource leaks.

What's the best way to prevent resource leaks from orphaned SSE connections?

Automatic cleanup via a background guardian process purges orphaned SSE streams by tracking active connections in Redis. This prevents resource leaks by removing streams from clients that have disconnected without proper closure.

How does heartbeat monitoring work for real-time SSE data delivery?

Heartbeat monitoring tracks active SSE streams in Redis and detects disconnected clients in real-time. When a client stops responding, the system identifies the dead connection and triggers cleanup to maintain stream integrity.

Can I ensure users receive the final output of a long-running process if their connection drops?

Yes, completion recovery stores terminal events in Redis so reconnecting clients can retrieve the final output of a long-running generation process. This ensures users never miss the result even if their connection drops and reconnects.