SDK Events Type Mismatch #1492

Closed
opened 2026-02-16 17:31:14 -05:00 by yindo · 5 comments
Owner

Originally created by @OliverGilan on GitHub (Aug 25, 2025).

Originally assigned to: @thdxr on GitHub.

Using the Opencode SDK as documented here.

When trying to subscribe to stream of events:

const eventStream = await opencode.event.subscribe();
for await (const event of eventStream) {
  console.log('Event:', event.type, event.properties);
  onEvent(event);
}

I get a type error in my IDE:

Type:
must have a [Symbol.asyncIterator]() method that returns an async iterator.

It's unclear how to actually consume this stream properly

Originally created by @OliverGilan on GitHub (Aug 25, 2025). Originally assigned to: @thdxr on GitHub. Using the Opencode SDK as documented [here](https://opencode.ai/docs/sdk/#install). When trying to subscribe to stream of events: ```typescript const eventStream = await opencode.event.subscribe(); for await (const event of eventStream) { console.log('Event:', event.type, event.properties); onEvent(event); } ``` I get a type error in my IDE: ``` Type: must have a [Symbol.asyncIterator]() method that returns an async iterator. ``` It's unclear how to actually consume this stream properly
yindo closed this issue 2026-02-16 17:31:14 -05:00
Author
Owner

@rekram1-node commented on GitHub (Aug 25, 2025):

The sdk isn't being generated properly, looks like it may be a stainless limitation for current subscription: https://www.stainless.com/docs/guides/configure#enterprise

@rekram1-node commented on GitHub (Aug 25, 2025): The sdk isn't being generated properly, looks like it may be a stainless limitation for current subscription: https://www.stainless.com/docs/guides/configure#enterprise
Author
Owner

@OliverGilan commented on GitHub (Aug 25, 2025):

I figured it was that. Didn’t know if the team was paying for that enterprise feature and just misconfigured or wasn’t on that tier.

Such a funny feature to price gate. I’ll try to create an example helper function that wraps the stream and turns it into an async iterable so we can update the docs to show how to consume the stream effectively

@OliverGilan commented on GitHub (Aug 25, 2025): I figured it was that. Didn’t know if the team was paying for that enterprise feature and just misconfigured or wasn’t on that tier. Such a funny feature to price gate. I’ll try to create an example helper function that wraps the stream and turns it into an async iterable so we can update the docs to show how to consume the stream effectively
Author
Owner

@rekram1-node commented on GitHub (Aug 25, 2025):

just realized it is generated w/ Hey API which supposedly does support the stream so this should be fixable

@rekram1-node commented on GitHub (Aug 25, 2025): just realized it is generated w/ Hey API which supposedly does support the stream so this should be fixable
Author
Owner

@rekram1-node commented on GitHub (Aug 27, 2025):

@OliverGilan dax just updated the sdk, and I updated docs

they haven't been published yet but here is commit fixing: https://github.com/sst/opencode/commit/0fbd7c84fd9f93f46eea2eec241a6fde07ce0d59

Next time they are released this will be fixed

@rekram1-node commented on GitHub (Aug 27, 2025): @OliverGilan dax just updated the sdk, and I updated docs they haven't been published yet but here is commit fixing: https://github.com/sst/opencode/commit/0fbd7c84fd9f93f46eea2eec241a6fde07ce0d59 Next time they are released this will be fixed
Author
Owner

@OliverGilan commented on GitHub (Aug 27, 2025):

Incredible. Thank you both

@OliverGilan commented on GitHub (Aug 27, 2025): Incredible. Thank you both
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1492