{"record":{"id":"9f6f19bddcc1d48a","repo":"deepseek-ai/deepseek-harness","slug":"tool-web-name-must-be-a-positive-integer","errorCode":null,"errorMessage":"tool-web: ${name} must be a positive integer","messagePattern":"tool-web: (.+?) must be a positive integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/web/tool-web/src/index.ts","lineNumber":70,"sourceCode":"}\n\nexport const Config: z<Config> = z.object({\n  search: z.boolean().default(true),\n  fetch: z.boolean().default(true),\n  searchMaxResults: z.number().default(WEB_SEARCH_MAX_RESULTS),\n  searchMaxQueries: z.number().default(WEB_SEARCH_MAX_QUERIES),\n  fetchTimeoutMs: z.number().default(DEFAULT_WEB_TOOL_TIMEOUT_MS),\n  searchTimeoutMs: z.number().default(DEFAULT_WEB_TOOL_TIMEOUT_MS),\n  fetchMaxOutputChars: z.number().default(DEFAULT_FETCH_MAX_OUTPUT_CHARS),\n})\n\n/** Complete config after schemastery applies every field default. */\ntype ResolvedConfig = Required<Config>\n\n/** Configured count, timeout, and character caps must be positive integers. */\nfunction assertPositiveInteger(name: string, value: number): void {\n  if (!Number.isInteger(value) || value < 1) {\n    throw new Error(`tool-web: ${name} must be a positive integer`)\n  }\n}\n\n/**\n * Register the enabled web tools. `search`/`fetch` default to true; a product\n * that wants only one disables the other in config. Each tool's cooperative\n * timeout budget (`fetchTimeoutMs`/`searchTimeoutMs`, default 30000) is resolved\n * here and attached to the tool as `ToolDefinition.timeoutMs` for\n * `@deepseek-ai/dsh-tool-call-timeout-policy` to enforce. The tools' disposers are\n * fiber-scoped (the effect-based registries clean up on dispose), so no manual\n * teardown is needed.\n */\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('searchMaxResults', resolved.searchMaxResults)\n  assertPositiveInteger('searchMaxQueries', resolved.searchMaxQueries)\n  assertPositiveInteger('fetchTimeoutMs', resolved.fetchTimeoutMs)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/web/tool-web/src/index.ts#L52-L88","documentation":"Error \"tool-web: ${name} must be a positive integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/web/tool-web/src/index.ts:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the named option to a positive 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"}