{"record":{"id":"e6c8799f46da88c1","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-observed","errorCode":"FS_NOT_OBSERVED","errorMessage":"cannot overwrite existing \"${target.displayPath}\" without reading it first","messagePattern":"cannot overwrite existing \"(.+?)\" without reading it first","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/e2b/fs-e2b/src/index.ts","lineNumber":478,"sourceCode":"      const entry = await sandbox.files.getInfo(path, signalOpts(signal))\n      assertNotAborted(signal, 'stat')\n      return entry\n    } catch (error: unknown) {\n      if (error instanceof FileNotFoundError) return undefined\n      throw mapError(error, 'stat', displayPath, signal)\n    }\n  }\n\n  private async requireRegular(target: FsTarget, signal?: AbortSignal): Promise<FsInfo> {\n    const info = await this.stat(target, signal)\n    if (info === undefined) throw new FsError(`cannot read \"${target.displayPath}\": not found`, 'FS_NOT_FOUND')\n    if (info.type !== 'file') throw new FsError(`cannot read \"${target.displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE')\n    return info\n  }\n\n  private checkWriteIntent(existing: EntryInfo | undefined, expected: FsWriteIntent | undefined, target: FsTarget): void {\n    if (expected?.kind === 'createIfAbsent' && existing !== undefined) {\n      throw new FsError(`cannot overwrite existing \"${target.displayPath}\" without reading it first`, 'FS_NOT_OBSERVED')\n    }\n    if (expected?.kind === 'replaceIfVersion') {\n      if (existing === undefined || entryVersion(existing) !== expected.version) {\n        throw new FsError(`cannot write \"${target.displayPath}\": file changed since it was read`, 'FS_STALE_VERSION')\n      }\n    }\n  }\n\n  private async readForDiff(target: FsTarget, signal?: AbortSignal): Promise<string | null> {\n    try {\n      const sandbox = await this.ctx.e2b.getSandbox()\n      const bytes = await sandbox.files.read(String(target.targetKey), { format: 'bytes', ...signalOpts(signal) })\n      assertNotAborted(signal, 'read')\n      return normalizeLineEndings(decodeText(bytes, target.displayPath, bytes.length))\n    } catch (error: unknown) {\n      if (error instanceof FsError && error.code === 'FS_NOT_TEXT') return null\n      throw mapError(error, 'read', target.displayPath, signal)\n    }","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/fs-e2b/src/index.ts#L460-L496","documentation":"Error \"cannot overwrite existing \"${target.displayPath}\" without reading it first\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/fs-e2b/src/index.ts:478 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"}