{"record":{"id":"089a10d371190bec","repo":"Budibase/budibase","slug":"invalid-agent-request-title-response","errorCode":null,"errorMessage":"Invalid agent request title response","messagePattern":"Invalid agent request title response","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/server/src/sdk/workspace/ai/agentRequests/helpers.ts","lineNumber":189,"sourceCode":"    agentId\n  )\n  const result = await generateText({\n    model: llm.chat,\n    providerOptions: llm.providerOptions?.(false),\n    headers: {\n      \"x-litellm-tags\": \"bb-agent-request-title\",\n    },\n    instructions:\n      \"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.\",\n    prompt: JSON.stringify({\n      operation,\n      latestPrompt,\n    }),\n  })\n\n  const title = normalizeTitle(result.text || \"\")\n  if (!title) {\n    throw new Error(\"Invalid agent request title response\")\n  }\n\n  return title\n}\n\nexport async function generateToolCallSummary({\n  toolName,\n  readableName,\n  status,\n  input,\n  output,\n  agentId,\n  sessionId,\n}: {\n  toolName: string\n  readableName?: string\n  status: \"success\" | \"error\"\n  input?: unknown","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/agentRequests/helpers.ts#L171-L207","documentation":"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\").","triggerScenarios":"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.","commonSituations":"Provider returning empty completions (content filtering, quota exhaustion returning empty body, misconfigured aiconfig); model that replies with only whitespace or refuses the prompt.","solutions":["Check the agent's aiconfig and LiteLLM logs for empty completions / content filtering","Catch the error and fall back to a derived title (e.g. truncated first words of latestPrompt)","Retry the title generation once before failing the request"],"exampleFix":"// before\nconst title = await generateAgentRequestTitle({ latestPrompt, ... })\n// after\nlet title\ntry {\n  title = await generateAgentRequestTitle({ latestPrompt, ... })\n} catch {\n  title = normalizePrompt(latestPrompt).split(\" \").slice(0, 6).join(\" \") || \"New request\"\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let title\ntry {\n  title = await generateAgentRequestTitle({ latestPrompt, agentId, sessionId })\n} catch (err) {\n  if (err instanceof Error && err.message === \"Invalid agent request title response\") {\n    title = normalizePrompt(latestPrompt).slice(0, 50) || \"New request\"\n  } else {\n    throw err\n  }\n}","preventionTips":["Verify the agent's aiconfig produces non-empty completions before rollout","Retry generation once on empty responses","Keep a deterministic fallback title derived from the prompt"],"tags":["llm","empty-response","agent-requests"],"backgroundTag":"llm-empty-response","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}