File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
packages/core/src/v3/inputStreams Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,7 @@ export class StandardInputStreamManager implements InputStreamManager {
224224
225225 async #runTail( runId : string , streamId : string , signal : AbortSignal ) : Promise < void > {
226226 try {
227+ const lastSeq = this . seqNums . get ( streamId ) ;
227228 const stream = await this . apiClient . fetchStream < unknown > (
228229 runId ,
229230 `input/${ streamId } ` ,
@@ -232,6 +233,8 @@ export class StandardInputStreamManager implements InputStreamManager {
232233 baseUrl : this . baseUrl ,
233234 // Max allowed by the SSE endpoint is 600s; the tail will reconnect on close
234235 timeoutInSeconds : 600 ,
236+ // Resume from last seen sequence number to avoid replaying history on reconnect
237+ lastEventId : lastSeq !== undefined ? String ( lastSeq ) : undefined ,
235238 onPart : ( part ) => {
236239 const seqNum = parseInt ( part . id , 10 ) ;
237240 if ( Number . isFinite ( seqNum ) ) {
You can’t perform that action at this time.
0 commit comments