{"record":{"id":"f703ddab3f83fcce","repo":"deepseek-ai/deepseek-harness","slug":"tool-fs-name-must-be-a-positive-integer","errorCode":null,"errorMessage":"tool-fs: ${name} must be a positive integer","messagePattern":"tool-fs: (.+?) must be a positive integer","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/index.ts","lineNumber":49,"sourceCode":"  readMaxBytes?: number\n  /** Files at or above this size stream instead of loading whole into memory. */\n  readStreamMinSize?: number\n}\n\nexport const Config: z<Config> = z.object({\n  readLimit: z.number().default(READ_LIMIT),\n  readMaxLineLength: z.number().default(READ_MAX_LINE_LENGTH),\n  readMaxBytes: z.number().default(READ_MAX_BYTES),\n  readStreamMinSize: z.number().default(STREAM_MIN_SIZE),\n})\n\n/** The shape after schemastery applied the defaults. */\ntype ResolvedConfig = Required<Config>\n\n/** Every read cap counts lines/chars/bytes — a positive integer, or windowing arithmetic misbehaves silently. */\nfunction assertPositiveInteger(name: string, value: number): void {\n  if (!Number.isInteger(value) || value < 1) {\n    throw new Error(`tool-fs: ${name} must be a positive integer`)\n  }\n}\n\n/** Register the full `read`/`write`/`edit` filesystem tool suite, plus `read_image` while `attachments` is mounted. */\nexport function apply(ctx: Context, config: Config): void {\n  // schemastery (Config) has already filled every defaulted field.\n  const resolved = config as ResolvedConfig\n  assertPositiveInteger('readLimit', resolved.readLimit)\n  assertPositiveInteger('readMaxLineLength', resolved.readMaxLineLength)\n  assertPositiveInteger('readMaxBytes', resolved.readMaxBytes)\n  assertPositiveInteger('readStreamMinSize', resolved.readStreamMinSize)\n  applyReadTool(ctx, {\n    limit: resolved.readLimit,\n    maxLineLength: resolved.readMaxLineLength,\n    maxBytes: resolved.readMaxBytes,\n    streamMinSize: resolved.readStreamMinSize,\n  })\n  // read_image is composition-conditional: without a mounted attachment store","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/index.ts#L31-L67","documentation":"Error \"tool-fs: ${name} must be a positive integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/index.ts:49 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"}