Budibase/budibase · error · Error

No response found

Error message

No response found

What it means

The legacy Budibase AI chatCompletion proxies the LLM call and expects a non-empty text result. When the provider returns a response without text (empty completion, filtered content, provider error swallowed by the SDK), the controller throws 'No response found'.

Source

Thrown at packages/server/src/api/controllers/ai/budibaseai.ts:85

}

export async function chatCompletion(
  ctx: Ctx<ChatCompletionRequest, ChatCompletionResponse>
) {
  if (env.SELF_HOSTED && !env.isDev()) {
    ctx.throw(500, "Budibase AI endpoints are not available in self-host")
  }

  const { chat, providerOptions } =
    await sdk.ai.llm.bbai.createBBAIClient(BBAI_DEFAULT_MODEL)
  const result = await generateText({
    model: chat,
    ...sdk.ai.llm.toPrompt(ctx.request.body.messages),
    providerOptions: providerOptions?.(false),
  })

  if (!result.text) {
    throw new Error("No response found")
  }

  const inputTokens =
    result.usage?.inputTokens ?? result.totalUsage.inputTokens ?? 0
  const outputTokens =
    result.usage?.outputTokens ?? result.totalUsage.outputTokens ?? 0
  const tokensUsed = calculateBudibaseAICredits(inputTokens, outputTokens)

  ctx.body = {
    messages: [
      ...ctx.request.body.messages,
      { role: "assistant", content: result.text },
    ],
    tokensUsed: tokensUsed || result.totalUsage.totalTokens || 0,
  }
}

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Inspect the request messages/prompt for content that could be filtered or produce empty output
  2. Verify the upstream provider credentials and model are valid and the provider is healthy
  3. Add retry logic with backoff for transient empty responses
  4. Migrate to the v2 endpoint (budibaseai-v2.ts) which has richer error handling

Example fix

// before
const result = await callLlm({ messages })
useText(result.text)
// after
try {
  const result = await callLlm({ messages })
  if (!result.text) throw new Error("No response found")
  useText(result.text)
} catch (e) {
  // retry or surface a friendly message
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!Array.isArray(messages) || messages.length === 0) {
  throw new Error("messages required before calling chat completion")
}

Type guard

const hasText = (r: { text?: unknown }): r is { text: string } =>
  typeof r.text === "string" && r.text.length > 0

Try / catch

try {
  const res = await chatCompletion(body)
} catch (e) {
  if (String(e.message).includes("No response found")) {
    // retry with backoff or fall back to another provider
  }
}

Prevention

When it happens

Trigger: POST chat completion via budibaseai.ts with messages that yield an empty result.text — e.g. all-content-filtered prompts, max_tokens too small, or provider outage returning empty text.

Common situations: Prompt triggers a content filter; provider returns empty completion; misconfigured provider/key silently returning blank responses; streaming disabled with an empty generation.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/0d40c23350d53419. Report an issue: GitHub.