feat: auto-generate session titles via the managed chat_title tool - #2351
Open
7Sageer wants to merge 7 commits into
Open
feat: auto-generate session titles via the managed chat_title tool#23517Sageer wants to merge 7 commits into
7Sageer wants to merge 7 commits into
Conversation
With the auto-title experimental flag on and a managed OAuth login, the
session title is generated from the first prompt, replacing the
truncated-prompt easy title. A custom title set by the user is never
overwritten, and generation failures degrade silently to the easy title.
- oauth: fetchChatTitle for the platform /tools chat_title method
- agent-core (v1): fire-and-forget generation on the first prompt
- agent-core-v2: sessionTitle domain watching the easy-title event
- kap-server: POST /sessions/{id}/title/generate for manual regeneration
|
Drop the automatic wiring on both engines: the v1 (TUI) first-prompt trigger and the v2 easy-title event watcher. SessionTitleService's generateTitle() stays as the single on-demand entry point behind the auto-title flag, backing the kap-server title/generate route. The changeset goes away too: with no shipped consumer, the remaining surface is not user-perceivable.
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked issue — the problem is explained below.
Problem
Session titles are currently derived by truncating the first user prompt to 200 characters. Long or pasted prompts produce unreadable sidebar titles, and users must rename sessions by hand via
/title. The managed platform already exposes achat_titletool that generates a concise title from chat content, but the client never calls it.What changed
Adds an experimental auto-title feature, gated by the
auto-titleexperimental flag (off by default;KIMI_CODE_EXPERIMENTAL_AUTO_TITLE=1). With the flag on and a managed Kimi Code OAuth login, the session title is generated from the first prompt and replaces the truncated-prompt easy title a moment later. The prompt text sent is the already-sanitizedlastPrompt(secrets are redacted by the existing prompt-metadata path), a custom title set by the user is never overwritten, and any failure degrades silently to the easy title. Users without a managed OAuth login (API key / third-party providers) are unaffected.fetchChatTitlefor the platform/toolschat_titlemethod, following the existing managed-endpoint conventions.session.meta.updated.sessionTitledomain (L6, Session scope) watching the easy-titlesession.meta.updatedevent on the session's own scope, with the same write-back semantics.POST /api/v1/sessions/{session_id}/title/generatefor on-demand (re)generation (404 for unknown sessions, 40922 when generation is unavailable), so the web UI can offer a "regenerate title" action.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update (experimental flag-gated feature; docs will follow when the flag is released).