[PR #5628] fix(acp): use single global event subscription and route by sessionID #11500

Closed
opened 2026-02-16 18:16:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5628

State: closed
Merged: Yes


Fixes https://github.com/sst/opencode/issues/5627

Description

Fixes ACP event duplication bug by switching from per-session SSE subscriptions to a single long-lived subscription and routing events by the payload sessionID.

The approach is inspired by the TUI’s event subscription loop (single subscription with reconnect + internal routing), and adds regression tests covering session isolation and non-duplication.

p.s. - if you prefer to keep the multiple subscribers but handle some registry that is invalidated on load session + sessionId guard to prevent cross session event updates - LMK I'll do that instead

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5628 **State:** closed **Merged:** Yes --- Fixes https://github.com/sst/opencode/issues/5627 ### Description Fixes ACP event duplication bug by switching from per-session SSE subscriptions to a single long-lived subscription and routing events by the payload sessionID. The approach is inspired by the TUI’s event subscription loop (single subscription with reconnect + internal routing), and adds regression tests covering session isolation and non-duplication. p.s. - if you prefer to keep the multiple subscribers but handle some registry that is invalidated on load session + sessionId guard to prevent cross session event updates - LMK I'll do that instead
yindo added the pull-request label 2026-02-16 18:16:20 -05:00
yindo closed this issue 2026-02-16 18:16:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11500