GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix OpenCode events on versions greater than 1.14.40 by samjandris · Pull Request #2673 · pingdotgg/t3code

Conversation

@samjandris

@samjandris samjandris commented May 13, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Replaces #2634, which was closed while still pointing at the old fork branch name.

Test plan

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run --cwd apps/server test src/provider/Layers/OpenCodeAdapter.test.ts

Note

Medium Risk
Changes the sole runtime event subscription path for OpenCode sessions; incorrect directory filtering or payload handling would break streaming or drop events for other workspaces on a shared server.

Overview
Fixes OpenCode assistant streaming on runtimes where the legacy /event stream is empty (e.g. versions after 1.14.40) by subscribing to client.global.event instead of event.subscribe.

The event pump now ignores global envelopes whose directory does not match the session cwd and forwards only event.payload into the existing handleSubscribedEvent path. OpenCodeSubscribedEvent is retargeted to that payload type.

Tests mock global.event (with optional keep-alive), make event.subscribe fail if used, and add coverage that directory-scoped global message.* events produce content.delta for the active turn.

Reviewed by Cursor Bugbot for commit 335fe3f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix OpenCode event streaming to use global.event for versions greater than 1.14.40

  • Switches the event pump in OpenCodeAdapter.ts from client.event.subscribe to client.global.event, passing the session AbortSignal.
  • Adds directory-based filtering so only events matching the session's working directory are processed; handlers now receive event.payload instead of the raw wrapper.
  • Updates the OpenCodeSubscribedEvent type to extract the payload from events with a payload field, matching the new API shape.
  • Adds a test in OpenCodeAdapter.test.ts that verifies global.event is called once and that message.updated/message.part.updated events produce the correct content.delta output.

Macroscope summarized 335fe3f.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@samjandris samjandris mentioned this pull request May 13, 2026
Fix OpenCode event session routing #2634
Closed
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels May 13, 2026
@coderabbitai

coderabbitai Bot commented May 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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: 4aa399ec-0e96-45b8-8465-288f55791446

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:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented May 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This is a targeted bug fix migrating from the event.subscribe API to global.event API for compatibility with newer OpenCode versions (>1.14.40). The change adds directory-based filtering to handle the new event wrapper format, with corresponding test coverage added.

You can customize Macroscope's approvability policy. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justsomelegs justsomelegs mentioned this pull request May 14, 2026
reconcile provider session state and settle stuck turns #2666
Closed
4 tasks done
@eersnington eersnington mentioned this pull request May 14, 2026
Fix: OpenCode event ingestion compatibility (fixes hanging "working..." state with OpenCode Adapter) #2704
Closed
@samjandris
samjandris force-pushed the fix/opencode-event-stream branch from f4137b5 to df55ea4 Compare May 20, 2026 12:20
@samjandris samjandris changed the title Fix OpenCode event session routing Fix OpenCode events > 1.40 May 20, 2026
@samjandris samjandris changed the title Fix OpenCode events > 1.40 Fix OpenCode events on versions greater than 1.40 May 20, 2026
@samjandris samjandris changed the title Fix OpenCode events on versions greater than 1.40 Fix OpenCode events on versions greater than 1.14.40 May 20, 2026
@samjandris
Fix OpenCode event session routing
43d5a84
@samjandris
samjandris force-pushed the fix/opencode-event-stream branch from df55ea4 to 43d5a84 Compare June 1, 2026 12:52
duncan4123 pushed a commit to duncan4123/t3code that referenced this pull request Jun 1, 2026
@claude
fix(opencode): switch event pump from event.subscribe to global.event
0d630ad
Cherry-pick upstream PR pingdotgg#2673 from pingdotgg/t3code.

OpenCode CLI >= 1.14.40 changed the event format: SSE events are now
wrapped in a { directory, payload } envelope via the /global/event
endpoint. The legacy event.subscribe() stream is empty on newer
versions, causing ALL events to be silently dropped.

Changes:
- Switch event subscription from client.event.subscribe() to
  client.global.event(), which emits global-scoped wrapped events
- Filter events by directory to match the session working directory,
  preventing cross-session event contamination
- Unwrap payload from the envelope before passing to
  handleSubscribedEvent()
- Update OpenCodeSubscribedEvent type to extract payload from
  global event stream

Test changes:
- Add global.event mock to OpenCodeRuntimeTestDouble with abortable
  async iterator and keep-alive support
- Add toGlobalEvent() helper to wrap raw events in { directory, payload }
- New test: "streams current OpenCode global event payloads for the
  session directory" — verifies directory filtering, global event
  stream usage, and that content.delta events reach the adapter
duncan4123 pushed a commit to duncan4123/t3code that referenced this pull request Jun 1, 2026
@claude
fix(opencode): remove duplicate global.event mock from test double
f918b9d
The cherry-pick of PR pingdotgg#2673 introduced a duplicate global property
in the OpenCodeRuntimeTestDouble object literal. The main branch
(t3-29f.9) already has a more complete global.event mock with
globalEventError support. Keep that one, remove the simpler
duplicate.
@samjandris
Fix OpenCode adapter test wait helper
65402bd
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 21, 2026
View reviewed changes
@samjandris
Fix OpenCode adapter test wait helper
0fab037
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 21, 2026 05:31

Dismissing prior approval to re-evaluate 0fab037

@samjandris
Use namespace import for OpenCode test timer
335fe3f
macroscopeapp[bot]
macroscopeapp Bot approved these changes Jun 21, 2026
View reviewed changes
@samjandris samjandris closed this Jun 21, 2026
@samjandris
samjandris deleted the fix/opencode-event-stream branch June 21, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

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.

Projects

None yet

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.

1 participant

@samjandris
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.