Repository navigation
fix(chat): generate concise sidebar session titles - #4462
Closed
Annabelle0726 wants to merge 1 commit into
Closed
Annabelle0726 wants to merge 1 commit into
Annabelle0726 wants to merge 1 commit into
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.
Description
Generated session titles can repeat too much of the first question and become hard to scan in the sidebar. Tighten the existing title prompt to summarize only the core topic and intent, aiming for 6–12 Chinese characters or 3–5 words in other languages. Cap generated titles at 24 Unicode runes and query-derived fallbacks at 20 runes.
This uses the existing first-user-message → configured LLM → persisted title → session-title event flow. It adds no model calls or provider configuration and preserves existing/user-edited titles. The concise-title instructions also apply when a custom prompt template is configured.
Type of Change
Testing
internal/application/servicetest package passed in the full root run, including the new first-message/model-selection/persistence tests.go vet ./...andgo build ./cmd/server: passed on this branch../internal/application/service: 0 issues, successful exit on the warm-cache retry.The full Linux
go test ./...run completed with failures outside this diff:ensurepip; after installingpython3-venvin the test image, the wholeinternal/agent/toolspackage passed.TestMinerUV1ClientCancelsJobOnTimeoutfailed during the loaded full run, then passed 3 consecutive focused runs without code changes.internal/models/parityrejectsapi.openai.combecause local DNS resolves it to a Teredo IPv6 address. The existing SSRF protection was kept intact; no security or DNS configuration was changed.Checks used Linux Go 1.26.9. The full suite is not claimed green in this environment. Upstream GitHub Actions currently require maintainer approval (
action_required), so remote CI has not run yet.Regression tests cover Unicode-safe length limits, the fallback bound, first-user-message selection, explicit/default KnowledgeQA model selection, persisted owner/title, and skipping generation for an existing title. Service tests use a fake implementation of the existing chat-model interface; no external LLM provider was called.
Checklist
git diff --check upstream/main...HEADpasses