diff --git a/src/main/runtime/orchestration/worker-transcript-remote-range-read.ts b/src/main/runtime/orchestration/worker-transcript-remote-range-read.ts index 4e06b701667..1403cb2c010 100644 --- a/src/main/runtime/orchestration/worker-transcript-remote-range-read.ts +++ b/src/main/runtime/orchestration/worker-transcript-remote-range-read.ts @@ -42,7 +42,6 @@ export async function readRemoteTranscriptRangedWindow(args: { provider: IFilesystemProvider filePath: string requestedOffset?: number - endOffset?: number expectedBoundaryCheckpoint?: string maxScanBytes: number }): Promise { @@ -51,10 +50,7 @@ export async function readRemoteTranscriptRangedWindow(args: { if (!sourceIdentity) { throw new Error('Remote transcript host did not provide stable file identity') } - if (args.endOffset !== undefined && remoteStat.size < args.endOffset) { - return null - } - const fileSize = Math.min(remoteStat.size, args.endOffset ?? remoteStat.size) + const fileSize = remoteStat.size const startOffset = args.requestedOffset ?? Math.max(0, fileSize - args.maxScanBytes) if (startOffset > fileSize) { return null diff --git a/src/main/runtime/orchestration/worker-transcript-remote-read.ts b/src/main/runtime/orchestration/worker-transcript-remote-read.ts index 4d317a7d645..1c2c68b98e0 100644 --- a/src/main/runtime/orchestration/worker-transcript-remote-read.ts +++ b/src/main/runtime/orchestration/worker-transcript-remote-read.ts @@ -32,7 +32,6 @@ type RemoteReadArgs = { sessionId: string transcriptPath?: string offset?: number - endOffset?: number limit?: number expectedBoundaryCheckpoint?: string filesystemProvider?: IFilesystemProvider @@ -90,7 +89,6 @@ async function readTranscriptWindow( provider, filePath, requestedOffset: args.offset, - endOffset: args.endOffset, expectedBoundaryCheckpoint: args.expectedBoundaryCheckpoint, maxScanBytes: MAX_REMOTE_TRANSCRIPT_SCAN_BYTES }) @@ -101,20 +99,13 @@ async function readTranscriptWindow( } } } - return readLegacyWindow( - provider, - filePath, - args.offset, - args.endOffset, - args.expectedBoundaryCheckpoint - ) + return readLegacyWindow(provider, filePath, args.offset, args.expectedBoundaryCheckpoint) } async function readLegacyWindow( provider: IFilesystemProvider, filePath: string, requestedOffset: number | undefined, - endOffset: number | undefined, expectedBoundaryCheckpoint: string | undefined ): Promise { const sourceIdentity = remoteWorkerTranscriptSourceIdentity(await provider.stat(filePath)) @@ -130,10 +121,7 @@ async function readLegacyWindow( throw new Error('Remote transcript read returned invalid content') } const allBytes = Buffer.from(result.content, 'utf8') - if (endOffset !== undefined && allBytes.length < endOffset) { - return null - } - const fileSize = Math.min(allBytes.length, endOffset ?? allBytes.length) + const fileSize = allBytes.length const startOffset = requestedOffset ?? Math.max(0, fileSize - MAX_REMOTE_TRANSCRIPT_SCAN_BYTES) if (startOffset > fileSize) { return null