{"record":{"id":"a42e2aac0f6f4c2f","repo":"deepseek-ai/deepseek-harness","slug":"skill-filesystem-failed-to-watch-state-root-pat","errorCode":null,"errorMessage":"skill-filesystem: failed to watch ${state.root.path}: ${errorMessage(error)}","messagePattern":"skill-filesystem: failed to watch (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/skill/skill-filesystem/src/index.ts","lineNumber":428,"sourceCode":"    if (this.closing || state.owners.size === 0) return\n    try {\n      const watcher = await this.openStableWatcher(state)\n      /* v8 ignore next -- The loop returns no handle only when teardown wins between awaited probes. */\n      if (watcher === undefined) return\n      /* v8 ignore start -- Post-open teardown is timing-dependent; the disposal race has an explicit integration test. */\n      // oxlint-disable-next-line typescript/no-unnecessary-condition -- teardown can race awaited watcher startup\n      if (this.closing || state.owners.size === 0) {\n        await this.closeWatcher(watcher)\n        return\n      }\n      /* v8 ignore stop */\n      state.watcher = watcher\n      state.unhealthy = false\n    } catch (error) {\n      // oxlint-disable-next-line typescript/no-unnecessary-condition -- teardown can race awaited watcher startup\n      if (!this.closing) {\n        state.unhealthy = true\n        this.ctx.logger.warn(`skill-filesystem: failed to watch ${state.root.path}: ${errorMessage(error)}`)\n      }\n      throw error\n    }\n  }\n\n  // TODO(file-watch-service): Extract Chokidar and missing-root observation below into a Cordis\n  // service; keep skill filtering and invalidation here.\n  private async openStableWatcher(state: RootWatchState): Promise<WatchHandle | undefined> {\n    while (!this.closing && state.owners.size > 0) {\n      const mode = await resolveRootWatchMode(state.root.path, this.config.followSymlinks)\n      const watcher = mode.kind === 'ancestor'\n        ? this.openAncestorWatcher(state, mode)\n        : await this.openRootWatcher(state, mode)\n      const current = await resolveRootWatchMode(state.root.path, this.config.followSymlinks)\n      /* v8 ignore else -- A host path transition between the two probes is timing-dependent. */\n      if (sameWatchMode(mode, current)) return watcher\n      /* v8 ignore next -- Covered by the same host path transition guard. */\n      await this.closeWatcher(watcher)","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/skill/skill-filesystem/src/index.ts#L410-L446","documentation":"Error \"skill-filesystem: failed to watch ${state.root.path}: ${errorMessage(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/skill/skill-filesystem/src/index.ts:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the skill root path exists and is watchable (permissions, fs watcher support)."],"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"}