{"record":{"id":"6b61a67e00b01a97","repo":"deepseek-ai/deepseek-harness","slug":"limit-must-be-less-than-or-equal-to-maxlimit","errorCode":null,"errorMessage":"limit must be less than or equal to ${maxLimit}","messagePattern":"limit must be less than or equal to (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/read.ts","lineNumber":60,"sourceCode":"\nfunction parsePositiveInteger(value: number, name: string): number {\n  if (!Number.isFinite(value) || !Number.isInteger(value) || value < 1) {\n    throw new Error(`${name} must be a positive integer`)\n  }\n  return value\n}\n\n/**\n * Validate value constraints the schema DSL can't express. `maxLimit` is the deployment's line cap.\n * @param args - the schema-validated raw tool arguments; `offset`/`limit` must be positive integers when given.\n * @param maxLimit - the configured line cap: both the default `limit` and the largest one accepted.\n * @returns the validated input with `offset` defaulted to 1 and `limit` to `maxLimit`.\n */\nexport function parseReadArgs(args: { file_path: string; offset?: number; limit?: number }, maxLimit: number): ReadInput {\n  if (args.file_path.trim().length === 0) throw new Error('file_path must be a non-empty string')\n  const offset = args.offset === undefined ? 1 : parsePositiveInteger(args.offset, 'offset')\n  const limit = args.limit === undefined ? maxLimit : parsePositiveInteger(args.limit, 'limit')\n  if (limit > maxLimit) throw new Error(`limit must be less than or equal to ${maxLimit}`)\n  return { filePath: args.file_path, offset, limit }\n}\n\n/**\n * Register the `read` tool and its system-prompt guidance.\n * @param ctx - the plugin context; registrations are effects scoped to it, and execution uses its `fs` service.\n * @param caps - the deployment's resolved read caps (plugin config after defaulting).\n */\nexport function applyReadTool(ctx: Context, caps: ReadToolCaps): void {\n  ctx.systemPrompt.section({\n    name: 'tool:read',\n    order: 100,\n    text: 'Use the read tool — not shell commands like cat — to inspect text files. Results include line numbers. Use offset and limit to continue reading large files.',\n  })\n\n  ctx.tools.register(defineTool({\n    name: 'read',\n    description: 'Read a UTF-8 text file and return line-numbered content.',","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/read.ts#L42-L78","documentation":"Error \"limit must be less than or equal to ${maxLimit}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/read.ts:60 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"}