Skip to content

fix(chat): generate concise sidebar session titles - #4462

Closed
Annabelle0726 wants to merge 1 commit into
Tencent:mainfrom
Annabelle0726:codex/concise-session-titles
Closed

Annabelle0726 wants to merge 1 commit into
Tencent:mainfrom
Annabelle0726:codex/concise-session-titles

Conversation

@Annabelle0726

@Annabelle0726 Annabelle0726 commented Oct 18, 2026 •

Copy link
Copy Markdown

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

  • 🐛 Bug fix
  • 🧪 Test

Testing

  • Focused title regressions: passed (the new bounds fail against unmodified upstream).
  • The entire internal/application/service test package passed in the full root run, including the new first-message/model-selection/persistence tests.
  • go vet ./... and go build ./cmd/server: passed on this branch.
  • golangci-lint v2.12.2, filtered with this PR's patch and scoped to ./internal/application/service: 0 issues, successful exit on the warm-cache retry.

The full Linux go test ./... run completed with failures outside this diff:

  • The minimal helper image lacked Python ensurepip; after installing python3-venv in the test image, the whole internal/agent/tools package passed.
  • The deployment-capability consistency test was sensitive to Windows CRLF checkout formatting; its focused rerun passed with LF source, without a committed content change.
  • TestMinerUV1ClientCancelsJobOnTimeout failed during the loaded full run, then passed 3 consecutive focused runs without code changes.
  • Remaining local environment limitation: internal/models/parity rejects api.openai.com because 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...HEAD passes
  • Changed Go files are gofmt-formatted
  • Targeted tests for the changed package pass
  • Diff-scoped Go lint passes
  • Full-repository checks were run; results are recorded above
  • Self-reviewed the code
  • Added regression tests
  • No breaking API or migration changes

@Annabelle0726
Annabelle0726 deleted the codex/concise-session-titles branch October 18, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant