-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
@agentuity/runtimeRuntime packageRuntime package
Description
AI SDK calls in SSE handlers fail with ReadableStream error when OTEL is enabled, despite the #471 fix.
Issue
Error: ReadableStream has already been used
Error: Connection lost
Observed in Model Arena demo within the SDK explorer where Anthropic provider shows the error and connection drops.
Workaround:
OTEL_SDK_DISABLED=true bun run devPotential Cause
The #471 fix wraps SSE handlers in ROOT_CONTEXT to bypass OTEL-instrumented fetch. This works for simpler cases but still fails when:
- Using
generateObject(not justgenerateText) - Running multiple AI SDK calls in parallel within an SSE handler
Potential Fixes
- Check if
generateObjecttriggers different OTEL instrumentation paths thangenerateText - Investigate whether parallel AI SDK calls inside SSE handlers need additional handling
- Verify ROOT_CONTEXT propagates correctly through Promise.all() with multiple provider calls
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@agentuity/runtimeRuntime packageRuntime package