{"record":{"id":"42193545b952a6c8","repo":"deepseek-ai/deepseek-harness","slug":"settings-file-reload-failed-at-s-keeping-the-la","errorCode":null,"errorMessage":"settings-file: reload failed at %s; keeping the last good document","messagePattern":"settings-file: reload failed at (.+?); keeping the last good document","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/settings/settings-file/src/index.ts","lineNumber":310,"sourceCode":"      throw new TypeError(`settings-file: ${this.spec.filename} must be a map of namespace sections`)\n    }\n    return root as Record<string, unknown>\n  }\n\n  /**\n   * Re-read the document after a watcher event. Unchanged content (including\n   * this provider's own writes) is a no-op; an unreadable or unparsable\n   * document keeps the last good sections and warns — a live hot-reload must\n   * never take the process down. An invariant violation escaping a commit is\n   * not a reload failure and propagates to the queue's error surface.\n   */\n  private async refresh(): Promise<void> {\n    if (this.closed) return\n    try {\n      await this.reconcileFromDisk()\n    } catch (error) {\n      if ((error as { code?: unknown } | null)?.code === 'INVARIANT') throw error\n      this.ctx.logger.warn('settings-file: reload failed at %s; keeping the last good document', this.spec.filename)\n      this.ctx.logger.warn(error)\n    }\n  }\n\n  /**\n   * Compare the on-disk text against the cache and publish any difference\n   * into the seam. Absence publishes the empty document; an unreadable or\n   * unparsable file throws, so each caller picks its policy — a reload warns\n   * and keeps the last good document, a write fails loud.\n   */\n  private async reconcileFromDisk(): Promise<void> {\n    let text: string | undefined\n    try {\n      text = await readFile(this.spec.filename, 'utf8')\n    } catch (error) {\n      if (!isENOENT(error)) throw error\n      text = undefined\n    }","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/settings/settings-file/src/index.ts#L292-L328","documentation":"Error \"settings-file: reload failed at %s; keeping the last good document\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/settings/settings-file/src/index.ts:310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the settings file syntax at the named path; the last good document is kept until a valid reload succeeds."],"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"}