Budibase/budibase · warning · Error

Invalid agent request title response

Error message

Invalid agent request title response

What it means

generateAgentRequestTitle asks the LLM for a short plain-text UI title and normalizes it (strips quotes/whitespace, collapses spaces). If the normalized result is empty — the model returned nothing, only quotes/whitespace, or an empty text — the function throws Error("Invalid agent request title response").

Source

Thrown at packages/server/src/sdk/workspace/ai/agentRequests/helpers.ts:189

    agentId
  )
  const result = await generateText({
    model: llm.chat,
    providerOptions: llm.providerOptions?.(false),
    headers: {
      "x-litellm-tags": "bb-agent-request-title",
    },
    instructions:
      "Write a short UI title for a tracked user request. Base it primarily on the user's actual ask, and use the selected operation only as supporting context. Do not invent internal workflow names, implementation details, or analysis phrasing. Prefer concrete user-facing nouns like the requested item, task, or deliverable. Return plain text only. Use 3 to 8 words, no quotes, no punctuation unless necessary.",
    prompt: JSON.stringify({
      operation,
      latestPrompt,
    }),
  })

  const title = normalizeTitle(result.text || "")
  if (!title) {
    throw new Error("Invalid agent request title response")
  }

  return title
}

export async function generateToolCallSummary({
  toolName,
  readableName,
  status,
  input,
  output,
  agentId,
  sessionId,
}: {
  toolName: string
  readableName?: string
  status: "success" | "error"
  input?: unknown

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Check the agent's aiconfig and LiteLLM logs for empty completions / content filtering
  2. Catch the error and fall back to a derived title (e.g. truncated first words of latestPrompt)
  3. Retry the title generation once before failing the request

Example fix

// before
const title = await generateAgentRequestTitle({ latestPrompt, ... })
// after
let title
try {
  title = await generateAgentRequestTitle({ latestPrompt, ... })
} catch {
  title = normalizePrompt(latestPrompt).split(" ").slice(0, 6).join(" ") || "New request"
}
Defensive patterns

Strategy: fallback

Try / catch

let title
try {
  title = await generateAgentRequestTitle({ latestPrompt, agentId, sessionId })
} catch (err) {
  if (err instanceof Error && err.message === "Invalid agent request title response") {
    title = normalizePrompt(latestPrompt).slice(0, 50) || "New request"
  } else {
    throw err
  }
}

Prevention

When it happens

Trigger: generateText resolves with an empty or whitespace/quote-only result.text, producing an empty normalized title. Called during initActiveRequest when a new agent request is created.

Common situations: Provider returning empty completions (content filtering, quota exhaustion returning empty body, misconfigured aiconfig); model that replies with only whitespace or refuses the prompt.

Related errors


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