{"record":{"id":"e6d1fb0206c0ccc8","repo":"deepseek-ai/deepseek-harness","slug":"fs-too-large","errorCode":"FS_TOO_LARGE","errorMessage":"cannot read \"${target.displayPath}\": ${info.size} bytes exceeds the ${maxBytes}-byte limit","messagePattern":"cannot read \"(.+?)\": (.+?) bytes exceeds the (.+?)-byte limit","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/e2b/fs-e2b/src/index.ts","lineNumber":252,"sourceCode":"  }\n\n  override async readText(target: FsTarget, signal?: AbortSignal): Promise<string> {\n    const sandbox = await this.ctx.e2b.getSandbox()\n    await this.requireRegular(target, signal)\n    try {\n      const bytes = await sandbox.files.read(String(target.targetKey), { format: 'bytes', ...signalOpts(signal) })\n      assertNotAborted(signal, 'read')\n      return decodeText(bytes, target.displayPath, BINARY_SAMPLE_BYTES)\n    } catch (error: unknown) {\n      throw mapError(error, 'read', target.displayPath, signal)\n    }\n  }\n\n  override async readBytes(target: FsTarget, signal: AbortSignal | undefined, maxBytes: number): Promise<Uint8Array> {\n    const sandbox = await this.ctx.e2b.getSandbox()\n    const info = await this.requireRegular(target, signal)\n    if (info.size !== undefined && info.size > maxBytes) {\n      throw new FsError(`cannot read \"${target.displayPath}\": ${info.size} bytes exceeds the ${maxBytes}-byte limit`, 'FS_TOO_LARGE')\n    }\n    const stream = await openReadStream(sandbox, target, signal)\n    const reader = stream.getReader()\n    const chunks: Uint8Array[] = []\n    let bytes = 0\n    let completed = false\n    try {\n      while (true) {\n        assertNotAborted(signal, 'read')\n        const next = await reader.read()\n        if (next.done) break\n        // The stat preflight covers the at-rest case; this streamed bound stops\n        // a post-stat grower without transferring past the first overflowing chunk.\n        bytes += next.value.byteLength\n        if (bytes > maxBytes) {\n          throw new FsError(`cannot read \"${target.displayPath}\": content exceeds the ${maxBytes}-byte limit`, 'FS_TOO_LARGE')\n        }\n        chunks.push(next.value)","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/fs-e2b/src/index.ts#L234-L270","documentation":"Error \"cannot read \"${target.displayPath}\": ${info.size} bytes exceeds the ${maxBytes}-byte limit\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/fs-e2b/src/index.ts:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}