opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(acp): use single global event subscription and route by sessionID

Open noamzbr opened this issue 1 month ago • 9 comments

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

noamzbr avatar Dec 16 '25 13:12 noamzbr

/review

rekram1-node avatar Dec 16 '25 17:12 rekram1-node

lgtm

github-actions[bot] avatar Dec 16 '25 17:12 github-actions[bot]

@rekram1-node lmk if there's anything you need me to change / add here

If it helps, been using my fork with the fix for a couple of days - so far muti-session & multi load ACP works great

noamzbr avatar Dec 21 '25 11:12 noamzbr