{"record":{"id":"52927cfe3b17e7af","repo":"deepseek-ai/deepseek-harness","slug":"harness-definetool-path-must-declare-a-valid-ty","errorCode":null,"errorMessage":"harness.defineTool ${path} must declare a valid type: ${VALID_TYPES} (got ${JSON.stringify(value.type)})","messagePattern":"harness\\.defineTool (.+?) must declare a valid type: (.+?) \\(got (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extensions/cordis-host-runner/src/guard.ts","lineNumber":413,"sourceCode":"          kind: 'value',\n          value: value.oneOf[index],\n          path: `${path}.oneOf[${index}]`,\n          forceRequired: false,\n          raw: task.raw,\n          parameterProperty: false,\n          destination: { kind: 'one-of', target: oneOf, index },\n        })\n      }\n      continue\n    }\n\n    if (task.raw && !Object.hasOwn(value, 'type')) {\n      assertSchemaKeys(value, path, ANNOTATION_KEYS)\n      prop.type = 'json'\n      continue\n    }\n    if (!SCHEMA_TYPES.has(value.type) || task.raw && value.type === 'json') {\n      throw new Error(`harness.defineTool ${path} must declare a valid type: ${VALID_TYPES} (got ${JSON.stringify(value.type)})`)\n    }\n    const type = value.type\n    prop.type = type\n\n    switch (type) {\n      case 'object': {\n        assertSchemaKeys(value, path, ['type', 'properties', 'additionalProperties', ...requiredKey, ...(task.raw ? ['required'] : []), ...ANNOTATION_KEYS])\n        if (!task.raw && (!Object.hasOwn(value, 'additionalProperties') || typeof value.additionalProperties !== 'boolean')) {\n          throw new Error(`harness.defineTool ${path}.additionalProperties must be explicitly true or false`)\n        }\n        if (task.raw && Object.hasOwn(value, 'additionalProperties') && typeof value.additionalProperties !== 'boolean') {\n          throw new Error(`harness.defineTool ${path}.additionalProperties must be a boolean`)\n        }\n        if (task.raw && 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        prop.additionalProperties = task.raw ? value.additionalProperties ?? true : value.additionalProperties\n        if (Object.hasOwn(value, 'properties')) {","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/extensions/cordis-host-runner/src/guard.ts#L395-L431","documentation":"Error \"harness.defineTool ${path} must declare a valid type: ${VALID_TYPES} (got ${JSON.stringify(value.type)})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/extensions/cordis-host-runner/src/guard.ts:413 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"}