{"record":{"id":"1b3fbe16ac64c9c9","repo":"deepseek-ai/deepseek-harness","slug":"tool-fs-search-name-must-be-a-positive-integer","errorCode":null,"errorMessage":"tool-fs-search: ${name} must be a positive integer","messagePattern":"tool-fs-search: (.+?) must be a positive integer","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs-search/src/index.ts","lineNumber":115,"sourceCode":"export const Config: z<Config> = z.object({\n  sampleOverCapGlobResults: z.boolean().required(),\n  globMaxResults: z.number().default(GLOB_MAX_RESULTS),\n  grepMaxMatches: z.number().default(GREP_MAX_MATCHES),\n  grepMaxLineBytes: z.number().default(GREP_MAX_LINE_BYTES),\n  searchMetaMaxBytes: z.number().default(SEARCH_META_MAX_BYTES),\n  rawOutputMaxBytes: z.number().default(RAW_OUTPUT_MAX_BYTES),\n  graceMs: z.number().default(SEARCH_GRACE_MS),\n  stderrMaxBytes: z.number().default(SEARCH_STDERR_MAX_BYTES),\n  timeoutMs: z.number().default(SEARCH_TIMEOUT_MS),\n})\n\n/** The shape after schemastery applied the defaults. */\ntype ResolvedConfig = Required<Config>\n\n/** Every search cap counts items/bytes/milliseconds — a positive integer, or retention and timeout arithmetic misbehaves silently. */\nfunction assertPositiveInteger(name: string, value: number): void {\n  if (!Number.isInteger(value) || value < 1) {\n    throw new Error(`tool-fs-search: ${name} must be a positive integer`)\n  }\n}\n\n/**\n * Register the `glob`/`grep` filesystem discovery tool suite. The packaged\n * ripgrep binary is always available (an npm dependency), so registration is\n * unconditional.\n *\n * @param ctx - plugin context; registrations are effects scoped to this plugin.\n * @param config - resolved plugin configuration from schemastery.\n */\n// oxlint-disable-next-line typescript/require-await -- async keeps a load-time config rejection a rejection, not a synchronous throw\nexport async function apply(ctx: Context, config: Config): Promise<void> {\n  // schemastery (Config) has already filled every defaulted field.\n  const resolved = config as ResolvedConfig\n  assertPositiveInteger('globMaxResults', resolved.globMaxResults)\n  assertPositiveInteger('grepMaxMatches', resolved.grepMaxMatches)\n  assertPositiveInteger('grepMaxLineBytes', resolved.grepMaxLineBytes)","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs-search/src/index.ts#L97-L133","documentation":"Error \"tool-fs-search: ${name} must be a positive integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs-search/src/index.ts:115 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"}