{"record":{"id":"b75bbb8a8b61eea6","repo":"deepseek-ai/deepseek-harness","slug":"file-search-maxresults-must-be-a-positive-safe-int","errorCode":null,"errorMessage":"file search maxResults must be a positive safe integer","messagePattern":"file search maxResults must be a positive safe integer","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/context/file-reference-local/src/search.ts","lineNumber":59,"sourceCode":"  promise: Promise<IndexedPath[]>\n}\n\n/**\n * Cancellable, reusable fuzzy index rooted at one agent working directory.\n * Directory-scoped queries list live state; bare fuzzy queries share one\n * bounded traversal until the `@` interaction ends or a tool result invalidates it.\n */\nexport class WorkspaceFileSearch {\n  private readonly excludedDirectories: ReadonlySet<string>\n  private generation: IndexGeneration | undefined\n  private disposed = false\n\n  constructor(\n    private readonly root: string,\n    private readonly config: FileSearchConfig,\n  ) {\n    if (!Number.isSafeInteger(config.maxResults) || config.maxResults <= 0) {\n      throw new Error('file search maxResults must be a positive safe integer')\n    }\n    if (!Number.isSafeInteger(config.maxEntries) || config.maxEntries <= 0) {\n      throw new Error('file search maxEntries must be a positive safe integer')\n    }\n    if (config.excludedDirectories.some(name => name.length === 0 || name.includes('/') || name.includes('\\\\'))) {\n      throw new Error('file search excludedDirectories entries must be non-empty directory basenames')\n    }\n    this.excludedDirectories = new Set(config.excludedDirectories)\n  }\n\n  /**\n   * Return ranked path candidates for the current token.\n   * @param rawQuery - path text following `@` or `@\"`.\n   * @param signal - cancels this caller's wait without killing an index shared by a newer query.\n   * @returns at most `maxResults` deterministic candidates.\n   */\n  async list(rawQuery: string, signal: AbortSignal): Promise<FileReferenceCandidate[]> {\n    signal.throwIfAborted()","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/context/file-reference-local/src/search.ts#L41-L77","documentation":"Error \"file search maxResults must be a positive safe integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/context/file-reference-local/src/search.ts:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the file search maxResults to a positive safe integer."],"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"}