Description
Automatic Conversation Titles give a new chat a concise, useful name after the first assistant exchange. Before that response exists, the runtime derives a short plain-text preview from the user's prompt, stripping Markdown so navigation never shows syntax noise or a generic “Untitled.” After a successful first turn, an injected title model can use both the user request and assistant response to produce a more representative title.
Title generation is deliberately off the critical path. The output is normalized to one line, stripped of Markdown, emoji, surrounding quotes, and trailing punctuation, then bounded by word and character limits. If the model is absent, throws, or returns an empty result, a deterministic prompt-based title wins. A manually renamed conversation stays sticky, and automation-created conversations can suppress the auto-title path in favor of their deterministic naming convention.
Selling Points
- New chats become recognizable in recents and search without requiring the user to stop and name them.
- The first completed exchange gives the title more context than the opening prompt alone.
- Deterministic fallback keeps navigation useful when a title model is unavailable or misbehaves.
- Sanitization prevents Markdown, emoji clutter, multiline output, or excessive length from degrading sidebar scanning.
- User ownership wins: once a person sets the title, background generation will not overwrite it.
User Story
A user opens a fresh conversation and asks an agent to investigate an intermittent deployment failure. The sidebar immediately shows a clean preview derived from that request. When the agent finishes, the conversation becomes “Investigate deployment failure” without blocking the answer. The user later renames it to include a project name, and subsequent activity never changes that chosen title.
Extension Surface
This feature is extensible. packages/chat/src/contracts/title-llm.ts defines the injected TitleLlmLike seam, and packages/chat/src/dispatch/commit-turn.ts accepts an optional suppression resolver for module-owned deterministic titles. These in-repo contracts allow alternate model adapters and policies, but there is no end-user title-generation plugin marketplace.
Capabilities & Limits
- It creates an immediate prompt preview and a post-response model-derived title.
- It sanitizes and bounds generated output, then falls back deterministically on any failure.
- It skips user-set titles, later turns, and automation conversations when configured.
- Limit: titles summarize the first exchange only; the system does not continually rename a conversation as its topic evolves.
Implementation Map
packages/chat/src/titles/title-generation.tspackages/chat/src/contracts/title-llm.tspackages/chat/src/dispatch/commit-turn.tspackages/chat/src/contracts/persistence.ts