{"record":{"id":"8bae6f17dbb61a39","repo":"deepseek-ai/deepseek-harness","slug":"harness-definetool-path-must-be-an-array-of-dec","errorCode":null,"errorMessage":"harness.defineTool ${path} must be an array of declared property names","messagePattern":"harness\\.defineTool (.+?) must be an array of declared property names","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extensions/cordis-host-runner/src/guard.ts","lineNumber":246,"sourceCode":"    if (Object.hasOwn(value, 'required') && value.required === undefined) {\n      throw new Error(`harness.defineTool ${path}.required must be an array of declared property names`)\n    }\n    const required = normalizeRequiredNames(value.required, value.properties, `${path}.required`)\n    const rootAnnotations: Record<string, unknown> = {}\n    copyAnnotations(value, rootAnnotations, path)\n    return {\n      spec: normalizePropertyMap(value.properties, path, required, true),\n      ...(Object.keys(rootAnnotations).length === 0 ? {} : { rootAnnotations }),\n    }\n  }\n  return { spec: normalizePropertyMap(value, path, new Set(), false) }\n}\n\n/** Validate raw required names and return their lookup set. */\nfunction normalizeRequiredNames(value: unknown, properties: Record<string, unknown>, path: string): Set<string> {\n  if (value === undefined) return new Set()\n  if (!isDensePlainArray(value)) {\n    throw new Error(`harness.defineTool ${path} must be an array of declared property names`)\n  }\n  const names = new Set<string>()\n  for (let index = 0; index < value.length; index++) {\n    const name = value[index]\n    if (typeof name !== 'string') {\n      throw new Error(`harness.defineTool ${path} must be an array of declared property names`)\n    }\n    names.add(name)\n    if (!Object.hasOwn(properties, name)) throw new Error(`harness.defineTool ${path} names undeclared property ${JSON.stringify(name)}`)\n  }\n  return names\n}\n\n/** Mutable holder used only while one normalized property-map root is unresolved. */\ninterface NormalizeRoot {\n  value?: Record<string, unknown>\n}\n","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/extensions/cordis-host-runner/src/guard.ts#L228-L264","documentation":"Error \"harness.defineTool ${path} must be an array of declared property names\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/extensions/cordis-host-runner/src/guard.ts:246 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"}