deepseek-ai/deepseek-harness · error · Error

file-reference-local: maxResults must be a positive safe int

Error message

file-reference-local: maxResults must be a positive safe integer

What it means

Error "file-reference-local: maxResults must be a positive safe integer" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/context/file-reference-local/src/index.ts:130

  }

  override list(
    agent: Agent,
    query: string,
    signal: AbortSignal,
  ): Promise<FileReferenceCandidate[]> {
    let search = this.searches.get(agent)
    if (search === undefined) {
      search = new WorkspaceFileSearch(agent.session.header.cwd ?? process.cwd(), this.config)
      this.searches.set(agent, search)
    }
    return search.list(query, signal)
  }
}

function validateConfig(config: FileSearchConfig): void {
  if (!Number.isSafeInteger(config.maxResults) || config.maxResults <= 0) {
    throw new Error('file-reference-local: maxResults must be a positive safe integer')
  }
  if (!Number.isSafeInteger(config.maxEntries) || config.maxEntries <= 0) {
    throw new Error('file-reference-local: maxEntries must be a positive safe integer')
  }
  if (config.excludedDirectories.some(name => name.length === 0 || name.includes('/') || name.includes('\\'))) {
    throw new Error('file-reference-local: excludedDirectories entries must be non-empty directory basenames')
  }
}

export default LocalFileReferenceService

View on GitHub (pinned to b150a551b8)

Solutions

  1. Set maxResults to a positive safe integer.

When it happens

Trigger: Thrown at packages/context/file-reference-local/src/index.ts:130 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/cd88fe119579c35b. Report an issue: GitHub.