fix(acp): use single global event subscription and route by sessionID
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
/review
lgtm
@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