Skip to content

Conversation titles don't generate correctly in agent templates (title request runs the full agent, not a title model) #239

Description

@goelise

Summary

In the bundled chat UI, the auto-generated conversation title is wrong. Instead of a short title, it comes back as a full agent answer — or, when the agent uses on-behalf-of (OBO) tools, as a refusal like "that capability isn't available right now." The title does not match the conversation.

This affects all agent-* templates, since they all clone the same UI (e2e-chatbot-app-next) and all set API_PROXY.

Why it happens

The UI is designed to generate titles with a separate, lightweight foundation model. In e2e-chatbot-app-next/packages/ai-sdk-providers/src/providers-server.ts:392-401:

if (API_PROXY) { return provider.responses(id); }          // returns first
if (id === 'title-model' || id === 'artifact-model') {     // intended title path
  return provider.chatCompletions('databricks-meta-llama-3-3-70b-instruct');
}

Every agent template sets API_PROXY to point the UI at the deployed agent's /invocations (see e.g. agent-openai-advanced/app.yaml and scripts/start_app.py). So the if (API_PROXY) branch always wins and the dedicated title-model / artifact-model route is dead code. Title requests are therefore routed to the agent like any other turn.

Result

The title request runs the full agent with all of its tools/MCP instead of a small title model. Worse, the title call carries no user/OBO token, so any OBO tool call fails — and the agent returns a "that capability isn't available" refusal (or a full tool-using answer) as the title.

Note on fixing

A simple reorder of the two branches is not sufficient: formatUrl: ({ baseUrl, path }) => API_PROXY ?? \${baseUrl}${path}` (providers-server.ts:252) rewrites the URL for every method on that provider, so chatCompletions('…llama…')would still be sent toAPI_PROXY` and hit the agent. The title/artifact path needs to bypass the proxy and call a foundation-model endpoint directly (which also assumes the deployed UI can reach that endpoint with the right token/scope, and that the hardcoded model name exists in the workspace).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions