Auto Title Plugin
The Auto Title plugin gives each conversation a meaningful, LLM-generated title
automatically — and, optionally, watches for the discussion drifting away from
that title and suggests a fresh one.
Status: explorative. Automatic re-titling on topic shift is an
experimental UX. Defaults are conservative (first-turn naming on, topic-shift
retitling off); tune to taste.
Overview
- First-turn naming (always on by default). When a conversation that has no title finishes its first turn, the plugin sends the user's message and the assistant's response to the LLM and renames the conversation to the result. The title is generated in the same language the user wrote in — the LLM is always instructed to match the user's language.
- Topic-shift retitling (opt-in). After each subsequent turn it shows the LLM the current title plus the last N exchanges and asks whether the topic has shifted significantly. This check is skipped for short conversations (below
min_context_chars_for_shift, default 10 000 chars) to avoid spurious warnings. If a shift is detected, it renames the conversation and posts a transcript card pointing out the shift and suggesting that starting a new conversation for the new topic usually gives better results.
The rename is broadcast as a conversation.renamed event, so the sidebar (and
any other open tab) updates live — no refresh needed.
How it works
- LLM access. Title generation is a single tool-free completion, so the plugin uses the direct model API (
AIModels.get_chat_model_for_role) instead of spawning a subagent. This respects per-user model profiles and, unlike a subagent, does not re-enter the agent loop (so it can't recursively re-trigger itself). Setmodel_roleto point at a cheaper/faster model profile if you have one configured. - Hooks. It captures the user's input on
onInputReceivedand does its work ononResponsePersist. The actual LLM call + rename run in a background task, so they never add latency to the turn the user is waiting on. - Where it runs. Only under the web/API UI (where a conversation store exists). In the CLI/TUI it is a no-op.
- Renaming. Goes through
ConversationService.rename_conversation, the same path the manual UI rename uses.
Configuration
plugins:
- module: codumentor.plugins.auto_title
class: AutoTitlePlugin
priority: 80
args:
enabled: true
name_after_first_turn: true
max_title_chars: 60
extra_instruction: ""
rename_on_topic_shift: false
topic_shift_turns: 2
min_context_chars_for_shift: 10000
model_role: auto_title
temperature: 0.3
max_tokens: 200
Configuration Parameters
| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Master switch for the plugin. |
name_after_first_turn | bool | true | Generate an initial title once an untitled conversation finishes its first turn. |
max_title_chars | int | 60 | Hard cap on generated title length (characters). Clamped to ≥ 10. |
extra_instruction | string | "" | Extra guidance appended to the prompts — e.g. a preferred style or a non-English language ("Always answer in Hungarian."). |
rename_on_topic_shift | bool | false | After each turn, ask the LLM whether the topic drifted; if so, retitle and show a card. |
topic_shift_turns | int | 2 | How many recent (user, assistant) exchanges to show the LLM when judging a shift. Clamped to ≥ 1. |
min_context_chars_for_shift | int | 10000 | Minimum total conversation context (characters) before topic-shift detection is attempted. Prevents spurious shift warnings on short conversations. Set to 0 to always check. |
model_role | string | auto_title | Model-profile role used for the LLM calls. Falls back to the global agent model when the role is not configured. |
temperature | float | 0.3 | Sampling temperature for the LLM calls. |
max_tokens | int | 200 | Max tokens for the LLM calls. |
The topic-shift card
When a shift is detected, the plugin emits a plugin.auto_title.topic_shift
event. It renders with the generic plugin-card renderer (no custom UI bundle):
- Collapsed header: a short hint plus the new title, e.g. "Database migration — New topic: “Postgres → SQLite migration”".
- Expanded: the previous title, the updated title, and a tip explaining why starting a fresh conversation for a new topic tends to give sharper results.
Notes & limitations
- If the LLM call fails or returns an empty/identical title, nothing changes — failures never affect the turn.
- A title the user set manually is never overwritten. First-turn naming only runs on an untitled conversation, and topic-shift retitling backs off when the most recent rename came from the user (tracked via the
sourcefield onconversation.renamed). Automatic titles, by contrast, can be replaced by a later topic-shift retitle. - Because the work is out-of-band, the title may appear a moment after the response finishes.