Fix OpenCode event session routing#2673
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR changes the event subscription model from session-scoped ( You can customize Macroscope's approvability policy. Learn more. |
Summary
Fixes #2633
Replaces #2634, which was closed while still pointing at the old fork branch name.
Test plan
Note
Cursor Bugbot is generating a summary for commit f4137b5. Configure here.
Note
Fix OpenCode event session routing by filtering global events by directory
OpenCodeAdapter.tsfromclient.event.subscribetoclient.global.event, which emits events for all directories.directorymatches the session's working directory are forwarded to the event handler.OpenCodeSubscribedEventtype alias to extract thepayloadfield from global events, resolving toneverfor events without a payload.OpenCodeAdapter.test.tsare updated to simulate long-lived, abortable global event streams and assert directory-scoped filtering behavior.event.subscribeis no longer used; the adapter now receives all directory events globally and filters client-side.Macroscope summarized f4137b5.