GeezerVison is showing github.com — Fix OpenCode event session routing by samjandris · Pull Request #2634 · pingdotgg/t3code
Conversation
samjandris
commented
May 11, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- switch OpenCode runtime events from the now-empty /event stream to /global/event
- unwrap global event payloads for the active session directory before using the existing provider event projection
- add regression coverage that the adapter uses the global event stream and handles wrapped OpenCode message events
Fixes #2633
Test plan
- bun fmt
- bun lint
- bun typecheck
- bun run --cwd apps/server test src/provider/Layers/OpenCodeAdapter.test.ts
Note Medium Risk
Changes how OpenCode runtime events are consumed and filtered (switching to global.event and dropping non-matching directories), which could affect event delivery/completion semantics across sessions if the upstream event shape differs.
Overview
Routes OpenCode runtime event consumption from the per-session event.subscribe stream to client.global.event, and updates the adapter to unwrap payload and ignore events not matching the session directory before projecting provider runtime events.
Updates the event type aliasing to reflect the wrapped global-event shape, and extends the test double + adds a regression test that enforces use of global.event (throwing if event.subscribe is called) and validates content.delta emission from wrapped message events for the correct session directory.
Reviewed by Cursor Bugbot for commit f4137b5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix OpenCode event session routing by filtering global events by directory
- Switches the event subscription in
OpenCodeAdapter.ts from client.event.subscribe to client.global.event, which emits events for all directories.
- Adds directory-based filtering so only events whose
directory matches the session's working directory are forwarded to the event handler.
- Updates the
OpenCodeSubscribedEvent type alias to extract the payload field from global events, resolving to never for events without a payload.
- Test doubles in
OpenCodeAdapter.test.ts are updated to simulate long-lived, abortable global event streams and assert directory-scoped filtering behavior.
- Behavioral Change:
event.subscribe is no longer used; the adapter now receives all directory events globally and filters client-side.
Macroscope summarized f4137b5.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
May 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 55b9fcd7-0c11-4402-8a03-ba38fa940586
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
- Generate code and open pull requests
- Plan features and break down work
- Investigate incidents and troubleshoot customer tickets together
- Automate recurring tasks and respond to alerts with triggers
- Summarize progress and report instantly
Built for teams:
- Shared memory across your entire org—no repeating context
- Per-thread sandboxes to safely plan and execute work
- Governance built-in—scoped access, auditability, and budget controls
One agent for your entire SDLC. Right inside Slack.
👉 Get started
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.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Needs human review
This PR changes runtime event routing by switching to a global event API and adding directory-based filtering. While focused and well-tested, the change affects which sessions receive which events, representing a meaningful runtime behavior change that warrants human review.
You can customize Macroscope's approvability policy. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a4eb68fadae2d34da3243a35ab10dee2725a08d5. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
samjandris
changed the title
Fix OpenCode event session routing
wip: Fix OpenCode event session routing
May 11, 2026
samjandris
changed the title
wip: Fix OpenCode event session routing
Fix OpenCode event session routing
May 11, 2026
samjandris
commented
May 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Replacement PR opened from the corrected fork branch: #2673 (samjandris:fix/opencode-event-stream).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
[Bug]: OpenCode not syncing/working
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|