{"record":{"id":"0f50af576c7c293a","repo":"eyaltoledano/claude-task-master","slug":"object-name-is-required-for-object-generation","errorCode":null,"errorMessage":"Object name is required for object generation","messagePattern":"Object name is required for object generation","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/ai-providers/base-provider.js","lineNumber":500,"sourceCode":"\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tthis.handleError('object streaming', error);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a structured object using the provider's model\n\t */\n\tasync generateObject(params) {\n\t\ttry {\n\t\t\tthis.validateParams(params);\n\t\t\tthis.validateMessages(params.messages);\n\n\t\t\tif (!params.schema) {\n\t\t\t\tthrow new Error('Schema is required for object generation');\n\t\t\t}\n\t\t\tif (!params.objectName) {\n\t\t\t\tthrow new Error('Object name is required for object generation');\n\t\t\t}\n\n\t\t\tlog(\n\t\t\t\t'debug',\n\t\t\t\t`Generating ${this.name} object ('${params.objectName}') with model: ${params.modelId}`\n\t\t\t);\n\n\t\t\tconst client = await this.getClient(params);\n\n\t\t\t// Get Sentry telemetry config with function ID and metadata for better tracing\n\t\t\t// Format: provider.model.command.method.objectName\n\t\t\tconst commandName = params.commandName || 'unknown';\n\t\t\tconst functionId = `${this.name}.${params.modelId}.${commandName}.generateObject.${params.objectName}`;\n\n\t\t\t// Build telemetry metadata for enhanced filtering/grouping in Sentry\n\t\t\tconst metadata = {\n\t\t\t\tcommand: commandName,\n\t\t\t\toutputType: params.outputType,","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/ai-providers/base-provider.js#L482-L518","documentation":"generateObject requires an objectName string that names the object being generated (used for logging and result extraction in the object response). The error is thrown when params.objectName is missing/empty while schema is present.","triggerScenarios":"Calling provider.generateObject({ modelId, messages, schema }) without objectName, or with objectName: undefined/'' — typically after adding a schema but forgetting the name.","commonSituations":"Migrating from generateText to generateObject; refactoring call sites where objectName was dropped; dynamically computed objectName evaluating to empty string.","solutions":["Pass a descriptive objectName string in the params","Ensure any dynamically computed objectName is non-empty","Include objectName together with schema — both are required for generateObject"],"exampleFix":"// before\nawait provider.generateObject({ modelId: 'x', messages, schema });\n// after\nawait provider.generateObject({ modelId: 'x', messages, schema, objectName: 'task' });","handlingStrategy":"validation","validationCode":"function assertGenerateObjectParams(params) {\n  if (!params?.schema) throw new Error('generateObject requires params.schema');\n  if (!params?.objectName || typeof params.objectName !== 'string') throw new Error('generateObject requires a non-empty params.objectName');\n}","typeGuard":"function hasObjectName(params) {\n  return typeof params === 'object' && params !== null && typeof params.objectName === 'string' && params.objectName.length > 0;\n}","tryCatchPattern":"try {\n  await provider.generateObject(params);\n} catch (e) {\n  if (e.message === 'Object name is required for object generation') {\n    console.error('params.objectName missing; pass a descriptive name');\n  } else throw e;\n}","preventionTips":["Include objectName whenever schema is passed to generateObject","Guard dynamically computed objectName against empty strings","Centralize generateObject calls in a helper that fills required fields"],"tags":["validation","structured-output","parameters"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}