openclaw - ✅(Solved) Fix [Feature] Auto-Generate Session Titles via AI Summarization [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77165Fetched 2026-05-05 05:51:30
View on GitHub
Comments
1
Participants
2
Timeline
10
Reactions
2
Author
Timeline (top)
referenced ×6cross-referenced ×2commented ×1labeled ×1

After a few message exchanges, automatically generate a concise descriptive title for the session using AI summarization, replacing the current behavior of truncating the first user message.

Root Cause

After a few message exchanges, automatically generate a concise descriptive title for the session using AI summarization, replacing the current behavior of truncating the first user message.

Fix Action

Fixed

PR fix notes

PR #77216: fix #77165: [Feature] Auto-Generate Session Titles via AI Summarization

Description (problem / solution / changelog)

Summary

Fixes #77165

Issue

[Feature] Auto-Generate Session Titles via AI Summarization

Changes

  • fix(sessions): use configurable maxChars in title prompt, remove dead turnCount field, add autoTitle tests
  • fix: resolve issue #77165

Changed Files

CHANGELOG.md                                    |   1 +
 src/auto-reply/reply/get-reply-run.ts           |  20 ++-
 src/auto-reply/reply/session-title-generator.ts | 197 ++++++++++++++++++++++++
 src/config/sessions/types.ts                    |   2 +
 src/config/types.openclaw.ts                    |   2 +
 src/config/types.session-title.ts               |   8 +
 src/config/zod-schema.ts                        |   8 +
 src/gateway/session-utils.test.ts               |  30 ++++
 src/gateway/session-utils.ts                    |  12 +-
 ui/src/ui/chat/session-controls.ts              |   5 +
 ui/src/ui/types.ts                              |   1 +
 11 files changed, 284 insertions(+), 2 deletions(-)

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/.generated/config-baseline.sha256 (modified, +2/-2)
  • src/auto-reply/reply/conversation-label-generator.ts (modified, +8/-1)
  • src/auto-reply/reply/get-reply-run.ts (modified, +22/-1)
  • src/auto-reply/reply/session-title-generator.ts (added, +225/-0)
  • src/config/schema.base.generated.ts (modified, +19/-0)
  • src/config/sessions/types.ts (modified, +2/-0)
  • src/config/types.openclaw.ts (modified, +2/-0)
  • src/config/types.session-title.ts (added, +8/-0)
  • src/config/zod-schema.ts (modified, +8/-0)
  • src/gateway/server-session-events.ts (modified, +1/-0)
  • src/gateway/session-utils.test.ts (modified, +30/-0)
  • src/gateway/session-utils.ts (modified, +11/-1)
  • ui/src/ui/chat/session-controls.ts (modified, +5/-0)
  • ui/src/ui/controllers/sessions.ts (modified, +1/-0)
  • ui/src/ui/types.ts (modified, +1/-0)

PR #77225: feat(sessions): auto-generate session titles via AI summarization

Description (problem / solution / changelog)

Summary

Auto-generate session titles via AI summarization after a configurable number of turns.

Closes #77165

Changes

  • aiTitle field on SessionEntry: New optional string field for AI-generated session titles
  • deriveSessionTitle priority: displayNamesubjectaiTitlefirstUserMessage (truncated) → sessionId prefix fallback
  • Config schema (agents.defaults.sessionTitle):
    {
      "sessionTitle": {
        "enabled": true,
        "turnsBeforeTitle": 3,
        "maxChars": 50
      }
    }
  • session-auto-title.ts: New module with triggerAutoTitleGeneration — counts user turns, extracts conversation summary, makes lightweight AI call, persists aiTitle
  • Lifecycle hook: Auto-title generation triggered asynchronously after successful run completion in finalizeLifecycleEvent
  • Session listings: aiTitle included in GatewaySessionRow for display
  • Schema labels & help text: Added for new config options

Design decisions

  • Async, non-blocking: Title generation is fire-and-forget; never blocks conversation flow
  • No regeneration: Once aiTitle is set, it is not overwritten on subsequent runs
  • Manual override preserved: User-set displayName always takes precedence over aiTitle
  • Lightweight AI call: Uses small prompt + max 60 tokens, targets the default model endpoint
  • Graceful degradation: If AI call fails (timeout, network, config), the session falls back to first-message truncation

Test plan

  • Verify aiTitle is populated after 3+ user turns in a session
  • Verify displayName takes precedence over aiTitle in deriveSessionTitle
  • Verify config sessionTitle.enabled: false disables auto-title
  • Verify manual rename (displayName) prevents AI title generation
  • Verify title generation does not block conversation

Changed files

  • src/config/schema.base.generated.ts (modified, +51/-0)
  • src/config/schema.help.ts (modified, +8/-0)
  • src/config/schema.labels.ts (modified, +4/-0)
  • src/config/sessions/types.ts (modified, +2/-0)
  • src/config/types.agent-defaults.ts (modified, +6/-0)
  • src/config/zod-schema.agent-defaults.ts (modified, +8/-0)
  • src/gateway/server-chat.ts (modified, +27/-0)
  • src/gateway/session-auto-title.ts (added, +290/-0)
  • src/gateway/session-utils.ts (modified, +5/-0)
  • src/gateway/session-utils.types.ts (modified, +1/-0)
  • ui/src/ui/chat/session-controls.ts (modified, +4/-0)
  • ui/src/ui/types.ts (modified, +1/-0)

Code Example

{
  "sessionTitle": {
    "enabled": true,
    "turnsBeforeTitle": 3,
    "maxChars": 50
  }
}
RAW_BUFFERClick to expand / collapse

Summary

After a few message exchanges, automatically generate a concise descriptive title for the session using AI summarization, replacing the current behavior of truncating the first user message.

Problem to solve

Currently, session titles in the ClawX Control UI are derived from the first few characters of the user's initial message. This results in:

  1. Uninformative titles — Truncated messages like "刚才安装了node.js" or "我们换一个邮箱吧" don't capture the full conversation topic.
  2. Hard to navigate — With many sessions open, it's difficult to find a specific past conversation in the sidebar.
  3. No context recall — A good title serves as a quick reminder of what was discussed; truncated messages provide no such benefit.

This is especially painful for power users who maintain dozens of sessions across different topics (coding, analysis, configuration, research, etc.).

Proposed solution

Desired behavior:

  1. Auto-trigger after N turns — After a configurable number of message exchanges (default ~3 rounds), call the current model with a lightweight prompt to summarize the session topic into a short title (≤50 chars).

  2. Replace the default title — Swap the truncated-message title with the AI-generated one in the sidebar and UI.

  3. Configurable via config.json:

{
  "sessionTitle": {
    "enabled": true,
    "turnsBeforeTitle": 3,
    "maxChars": 50
  }
}
  1. Toggle on/off — Users can disable the feature entirely or adjust the turn threshold.

  2. Efficient generation — Use a minimal context window (just the first few messages) to keep token cost negligible. Could even use a smaller model if available.

Implementation considerations:

  • Run title generation asynchronously so it doesn't block the conversation
  • Cache the generated title; don't regenerate on every session load
  • Allow manual override (user can rename sessions themselves)

Alternatives considered

  • Manual renaming only — Users can manually rename sessions, but this requires remembering to do it and adds friction. Most users won't bother.
  • Longer truncation — Showing more characters from the first message helps slightly but doesn't solve the core problem of uninformative titles.
  • Timestamp-based titles — Even less useful than message truncation for recall purposes.

Impact

Affected: All ClawX / OpenClaw desktop users, especially power users with many concurrent or historical sessions.

Severity: Medium — Annoying quality-of-life issue, doesn't block workflow but degrades the user experience.

Frequency: Always — Every new session gets an uninformative title by default.

Consequence: Extra time spent scrolling/searching for past conversations. Reduces the value of session history as a knowledge management tool.

Evidence/examples

Prior art (industry standard):

  • ChatGPT: Auto-generates titles after first message, shown in sidebar
  • Claude: Same behavior — concise AI-generated titles for each conversation
  • Cursor: Auto-titled chats in the sidebar
  • Gemini: Similar auto-naming behavior

All major AI chat applications support this feature as a basic UX expectation.

Additional information

No response

extent analysis

TL;DR

Implement an AI-powered session title generation feature that auto-triggers after a configurable number of message exchanges to replace uninformative truncated titles.

Guidance

  • Introduce a new configuration option in config.json to enable/disable the feature and set the number of turns before generating a title.
  • Develop an asynchronous title generation process using a lightweight AI model, caching the result to avoid regeneration on every session load.
  • Allow users to manually override generated titles and provide an option to toggle the feature on/off.
  • Consider using a smaller AI model to minimize token cost and optimize performance.

Example

{
  "sessionTitle": {
    "enabled": true,
    "turnsBeforeTitle": 3,
    "maxChars": 50
  }
}

This example shows the proposed configuration format for the session title generation feature.

Notes

The implementation should ensure that the title generation process does not block the conversation flow and that the generated title is concise and informative.

Recommendation

Apply the proposed solution to introduce AI-generated session titles, as it addresses the core issue of uninformative titles and provides a better user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature] Auto-Generate Session Titles via AI Summarization [2 pull requests, 1 comments, 2 participants]