{"record":{"id":"1621e5e49e220d07","repo":"Budibase/budibase","slug":"failed-to-generate-instructions","errorCode":null,"errorMessage":"Failed to generate instructions","messagePattern":"Failed to generate instructions","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/instructions.ts","lineNumber":60,"sourceCode":"    message => message.role === \"user\"\n  )?.content\n\n  if (typeof systemMessage !== \"string\" || typeof userMessage !== \"string\") {\n    throw new Error(\"AI prompt messages must be strings\")\n  }\n\n  const { chat, providerOptions } = await sdk.ai.llm.getDefaultLLMOrThrow()\n  const result = await generateText({\n    model: chat,\n    instructions: systemMessage,\n    prompt: userMessage,\n    providerOptions: providerOptions?.(false),\n  })\n\n  const instructions = sanitizeInstructions(result.text || \"\")\n\n  if (!instructions) {\n    throw new Error(\"Failed to generate instructions\")\n  }\n\n  return instructions\n}\n","sourceCodeStart":42,"sourceCodeEnd":65,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/instructions.ts#L42-L65","documentation":"Error \"Failed to generate instructions\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/sdk/workspace/ai/instructions.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":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}