Repository navigation
Description
Problem
Desktop sessions all show "New Chat" in the sidebar until the user manually renames them. CLI TUI (maka chat) uses prompt.slice(0, 42) as the title, which works but produces truncated, hard-to-scan titles for long first messages. There is no automatic title generation from conversation content.
Desired outcome
Sessions get a descriptive 5-10 word title automatically, generated by an LLM call after the first user message. The user sees a meaningful title in the sidebar / session list without manual action.
Design decisions (informed by surveying Grok Build, Codex, OpenCode, DeepSeek-Reasonix, OpenHands):
- LLM generation: Use the session's current model to generate a short title via a lightweight tool call. No dedicated small-model config; reuse the existing connection.
- Trigger: After the first user message, async, does not block the agent loop. All surveyed products (Grok Build, Codex, OpenCode, DeepSeek-Reasonix) trigger at first user message, none wait for the first turn to complete.
- Input: First user message only. Strip
<system-reminder>blocks and skill XML markup, cap at 8 KB (same preprocessing as Grok Build'stitle_source_text). - Fallback: If the LLM call fails or returns empty, fall back to
firstLine(prompt).slice(0, 42)(the CLI's existing logic). - Manual rename priority: Add
titleIsManual: booleantoSessionHeader. Manual rename sets it totrue; auto-generated titles only write whentitleIsManual === falseand the name is still the default. This prevents a late-arriving auto title from clobbering a user-set name. - Scope: Desktop sidebar + CLI TUI
maka chat.maka runkeeps its existingfirstLine(prompt).slice(0, 42)logic (one-shot execution, no need for async title generation).
Implementation areas:
packages/storage:SessionHeader.titleIsManualfield;setGeneratedTitleIfAbsent()method (only writes when not manual and name is default)packages/runtime: title generation logic (LLM tool call + fallback), triggered after first user messageapps/desktop: wire auto-title into first-message event, update sidebar on title arrivalpackages/cli:session-driver.tstriggers auto-title in TUI chat mode; existingprompt.slice(0, 42)becomes fallback
Alternatives or workarounds
Today the user must manually rename every session via /rename (CLI) or the sidebar inline rename (Desktop). The alternative of截断首条消息 (truncating the first message, as CLI already does) is cheap but produces low-quality titles for long or complex prompts. No LLM-based auto-naming exists today.
Activity
Colafornia commentedon Jul 16, 2026
I’d like to work on this issue.
Astro-Han commentedon Jul 16, 2026
Assigned @Colafornia !
feat: generate session titles automatically (apache#1063)
feat: generate session titles automatically (apache#1063)
feat: generate session titles automatically (apache#1063)
feat: generate session titles automatically (#1063) (#1199)