Repository navigation
feat: generate session title suggestions from the rename dialog - #669
Merged
Merged
Conversation
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.
What
Session titles can now be summarized by the model only when the user asks for it, from the rename dialog on both Desktop and mobile:
zh/en), at most 32 display columns. 6–12 Chinese characters or 3–6 English words is preferred.Why
An earlier iteration let the model decide on its own when to rename, controlled by a Desktop setting. Live testing with real models showed the trigger was unreliable: with the opt-in instruction the model renamed consistently on some turns, but missed mid-conversation enablement on some models, and when the instruction was shortened for prompt budget, misses increased further. Any variant also had to inject title state into the system prompt, which perturbs the cached prompt prefix.
The behavior is therefore now deterministic and user-driven, and the conversation prompt carries no title state or title instructions at all. Renaming- or UI-language changes cannot alter a session's system prompt.
Implementation
generate_session_titleRPC (agent): independent tool-free model request, read-only. It builds context from the first three user/assistant exchanges and never runs the agent loop or writes to the session. It deliberately does not hydrate a cold session, because hydration can reconcile and persist a different model; it instead resolves the session's persisted/selected model and replaces nothing (unknown model → explicit error). Non-retryable 60s command policy, so the transport never double-spends a model call.generate_thread_titleTauri command +generateThreadTitlestorage client, wired throughuseThreadDialogs(generation is guarded against duplicate clicks and scoped to the open dialog) andRenameDialog. The remote bridge forwards the same command for mobile.remote.generateTitle→ cataloggenerate_title, andRenameModalgains the button, an in-flight state, and a pending-generation guard keyed to dialog open/target.autoSessionTitle/uiLanguageagent settings and their Desktop toggle/language sync, and thefuture session titleCLI command. Conversations carry no title state or title instructions.docs/internals/desktop/PRODUCT.md(settings/behavior) andER.md(RPC and config ownership) updated.Verification
future-agent,future-cli,future-rpc): fmt + clippy--all-targets -D warningsclean; tests pass (agent 1782 passed/1 ignored, cli 725, plus integration suites). New unit tests cover context selection (first three pairs only, no tools/reasoning/model context, per-side caps), tool-free localized generation, refusal to return a title on incomplete/empty/failed generation, and that an unavailable session model neither hydrates the session nor rewrites its stored model.tsc --noEmit,eslint,vitest1080 passed.src-tauri: fmt + clippy clean, 1263 passed/1 ignored, including a new test that generation returns a draft without renaming and surfaces errors without touching the stored title.tsc --noEmit,eslint, and jest 1409 passed/1 failed. The single failure isMarkdownText layout and fidelity › large file previews virtualize blocks and bypass the shared message parse cache, which is pre-existing on main and macOS-only — the file and its test are byte-identical toorigin/mainand the "Mobile typecheck + lint + test" job passes on Linux CI for perf(mobile): responsive streaming, fewer wakeups, incremental rich Markdown #664/perf(mobile): pause covered chat rendering and bound file previews #665/chore: shorten the mobile sync notice and drop the claude/* branch convention #666. It is unrelated to this change and left untouched.流式会话列表性能优化,Image zoom & streaming input) while session revision, entry count and run count stayed unchanged; only an explicitset_session_namewith the suggestion updated the title. Sessions without completed pairs and sessions with an unavailable model failed explicitly with no fallback model and no mutation.Notes