-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Improve session derived titles to show conversation core content, not just first user message #81781
Copy link
Copy link
Open
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
title: "[Feature]: Improve session derived titles to show conversation core content, not just first user message"
labels: ["enhancement"]
Summary
Improve session
derivedTitlegeneration to use compaction summaries and/or last meaningful user message as the primary title source, instead of only the first user message, so the session picker shows what the conversation is actually about.Problem to solve
When switching sessions via
/sessionin TUI or Control UI, the session picker shows titles that often don't reflect the actual content of the conversation. This is because thederiveSessionTitlefunction (session-utils.ts) currently uses, in order:entry.displayName(usually empty for DM sessions)entry.subject(usually empty for DM sessions)sessionId[0:8] + date(format likedf33e0c5 (2026-05-14)— not helpful)The first user message is often just "Hi", "在吗", "/help", or a simple greeting — it rarely captures the core topic of the session. For users with many sessions (especially active Bot users across QQ, Telegram, etc.), the session picker becomes a wall of cryptic prefixes and greeting messages, making it impossible to quickly find a relevant conversation.
Affected users: All OpenClaw users who use session switching (TUI, Control UI, CLI)
Severity: Medium — annoying workflow friction
Frequency: Every time a user has multiple active sessions and needs to switch
Consequence: Extra mental overhead, wrong session selected, time wasted scrolling through unhelpful titles
Proposed solution
Enhance
deriveSessionTitle()with two additional, higher-quality title sources:Priority order (new)
entry.displayName(unchanged — group/channel metadata)entry.subject(unchanged)sessionId[0:8] + date(unchanged — final fallback)Implementation notes
The existing code has most of the infrastructure:
deriveSessionTitle()insrc/session/session-utils.tsreadSessionTitleFieldsFromTranscript()reads the first few lines of the transcript JSONL for thefirstUserMessagesession.derivedTitle ?? session.displayNamewithincludeDerivedTitles: trueWhat needs to change:
A) Compaction summary as title (recommended path):
sessions.jsonentries already have acompactionCheckpointsarrayB) Better message selection:
C) The TUI label format is already good:
With compact title + preview, this works well once titles are meaningful.
Alternatives considered
sessions.json. This would give the best quality but adds cost and latency./renameslash command or session patch API. Useful but requires user action; doesn't solve the default case.lastMessagePreviewin the session list (used in TUI description line). This is a good complement but not a replacement for the title.The compaction summary approach has the best quality/cost ratio since compaction already runs on long sessions.
Evidence/examples
Current behavior in TUI session picker (pseudocode):
Desired behavior:
Relevant code locations (based on source analysis):
deriveSessionTitle()src/config/session-utils.tsreadSessionTitleFieldsFromTranscript()src/config/session-utils.tsextractFirstUserMessageFromTranscriptChunk()src/config/session-utils.tssrc/config/session-types.tscompactionCheckpointsin session entrysrc/tui/tui.tssession.derivedTitle ?? session.displayNameAdditional information
sessions_listtool already hasincludeDerivedTitlesandincludeLastMessagesupportlastMessagePreviewandtimeAgo— the title just needs to be more usefulderivedTitleis computed dynamically at list time