fix: Remove agent:output from general SSE subscriptions to prevent listener leak
agent:output is high-frequency streaming data that was included in ALL_EVENT_TYPES and AGENT_EVENT_TYPES, causing every onEvent/onAgentUpdate SSE subscription to register a listener. With multiple subscriptions per browser tab plus reconnections, this exceeded the 100 listener limit. The dedicated onAgentOutput subscription handles output streaming already. Bonus: stops useLiveUpdates from refetching listAgents on every output chunk.
This commit is contained in:
@@ -40,7 +40,6 @@ export const ALL_EVENT_TYPES: DomainEventType[] = [
|
||||
'agent:account_switched',
|
||||
'agent:deleted',
|
||||
'agent:waiting',
|
||||
'agent:output',
|
||||
'task:queued',
|
||||
'task:dispatched',
|
||||
'task:completed',
|
||||
@@ -84,7 +83,6 @@ export const AGENT_EVENT_TYPES: DomainEventType[] = [
|
||||
'agent:account_switched',
|
||||
'agent:deleted',
|
||||
'agent:waiting',
|
||||
'agent:output',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -204,13 +204,13 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE
|
||||
| Procedure | Type | Events |
|
||||
|-----------|------|--------|
|
||||
| onEvent | subscription | All event types |
|
||||
| onAgentUpdate | subscription | agent:* events (8 types) |
|
||||
| onAgentUpdate | subscription | agent:* events (7 types, excludes agent:output) |
|
||||
| onTaskUpdate | subscription | task:* + phase:* events (8 types) |
|
||||
| onPageUpdate | subscription | page:created/updated/deleted |
|
||||
| onPreviewUpdate | subscription | preview:building/ready/stopped/failed |
|
||||
| onConversationUpdate | subscription | conversation:created/answered |
|
||||
|
||||
Subscriptions use `eventBusIterable()` — queue-based async generator, max 1000 events, 30s heartbeat.
|
||||
Subscriptions use `eventBusIterable()` — queue-based async generator, max 1000 events, 30s heartbeat. `agent:output` is excluded from all general subscriptions (it's high-frequency streaming data); use the dedicated `onAgentOutput` subscription instead.
|
||||
|
||||
## Coordination Module
|
||||
|
||||
|
||||
Reference in New Issue
Block a user