File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/core/src/v3/inputStreams Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ export class StandardInputStreamManager implements InputStreamManager {
4141 }
4242
4343 on ( streamId : string , handler : InputStreamHandler ) : { off : ( ) => void } {
44+ this . #requireV2Streams( ) ;
45+
4446 let handlerSet = this . handlers . get ( streamId ) ;
4547 if ( ! handlerSet ) {
4648 handlerSet = new Set ( ) ;
@@ -71,6 +73,8 @@ export class StandardInputStreamManager implements InputStreamManager {
7173 }
7274
7375 once ( streamId : string , options ?: InputStreamOnceOptions ) : Promise < unknown > {
76+ this . #requireV2Streams( ) ;
77+
7478 // Lazily connect the tail on first listener registration
7579 this . #ensureTailConnected( ) ;
7680
@@ -170,8 +174,16 @@ export class StandardInputStreamManager implements InputStreamManager {
170174 this . buffer . clear ( ) ;
171175 }
172176
177+ #requireV2Streams( ) : void {
178+ if ( this . currentRunId && this . streamsVersion !== "v2" ) {
179+ throw new Error (
180+ "Input streams require v2 realtime streams. Enable them with: { future: { v2RealtimeStreams: true } }"
181+ ) ;
182+ }
183+ }
184+
173185 #ensureTailConnected( ) : void {
174- if ( ! this . tailAbortController && this . currentRunId && this . streamsVersion === "v2" ) {
186+ if ( ! this . tailAbortController && this . currentRunId ) {
175187 this . connectTail ( this . currentRunId ) ;
176188 }
177189 }
You can’t perform that action at this time.
0 commit comments