openclaw - ✅(Solved) Fix Feature Request: Session title/summary for better session identification [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#56308Fetched 2026-04-08 01:42:24
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
referenced ×3cross-referenced ×2

PR fix notes

PR #78: feat(sessions): auto-generate session title after first exchange

Description (problem / solution / changelog)

Summary

  • Auto-generate a concise LLM-powered session title after the first user+assistant exchange
  • Write the title to the session's label field via sessions.patch RPC (auto-broadcasts WS notification to frontend)
  • Add label to deriveSessionTitle() priority chain so titles appear in TUI/ACP/WebChat

How it works

  1. After the first successful user reply in attempt.ts, a fire-and-forget call triggers maybeGenerateSessionTitle()
  2. Guard checks: only trigger === "user", first exchange (assistantCount === 1), no existing label, not subagent/temp/cron
  3. Uses prepareSimpleCompletionModelForAgent for a lightweight one-shot LLM call (no full agent runtime, no recursion risk)
  4. Prompt instructs: "Generate title in the same language as the user's message"
  5. Writes label via callGateway("sessions.patch") — uniqueness collision retries with (HH:MM) suffix

Files

FileChange
src/agents/session-auto-title.tsNew — core logic
src/agents/session-auto-title.test.tsNew — 23 tests
src/agents/simple-completion-runtime.tsPorted from upstream — lightweight LLM API
src/agents/github-copilot-token.tsPorted from upstream — dep of above
src/gateway/session-utils.ts+4 lines — label in deriveSessionTitle
src/gateway/session-utils.test.ts+18 lines — label priority tests
src/agents/pi-embedded-runner/run/attempt.ts+15 lines — fire-and-forget wiring

Test plan

  • 23 unit tests covering guards, prompt building, title cleaning, collision retry, integration
  • pnpm test -- src/agents/session-auto-title.test.ts — all pass
  • pnpm tsgo — zero type errors on touched files
  • pnpm format — clean
  • Manual: start a new session, send one message, verify label appears in session list

Ref: openclaw/openclaw#56308

🤖 Generated with Claude Code

Changed files

  • .agents/archive/PR_WORKFLOW_V1.md (removed, +0/-181)
  • .agents/archive/merge-pr-v1/SKILL.md (removed, +0/-304)
  • .agents/archive/merge-pr-v1/agents/openai.yaml (removed, +0/-4)
  • .agents/archive/prepare-pr-v1/SKILL.md (removed, +0/-336)
  • .agents/archive/prepare-pr-v1/agents/openai.yaml (removed, +0/-4)
  • .agents/archive/review-pr-v1/SKILL.md (removed, +0/-253)
  • .agents/archive/review-pr-v1/agents/openai.yaml (removed, +0/-4)
  • .agents/maintainers.md (added, +1/-0)
  • .agents/skills/PR_WORKFLOW.md (removed, +0/-249)
  • .agents/skills/merge-pr/SKILL.md (removed, +0/-99)
  • .agents/skills/merge-pr/agents/openai.yaml (removed, +0/-4)
  • .agents/skills/mintlify/SKILL.md (removed, +0/-345)
  • .agents/skills/prepare-pr/SKILL.md (removed, +0/-122)
  • .agents/skills/prepare-pr/agents/openai.yaml (removed, +0/-4)
  • .agents/skills/review-pr/SKILL.md (removed, +0/-142)
  • .agents/skills/review-pr/agents/openai.yaml (removed, +0/-4)
  • .detect-secrets.cfg (modified, +19/-4)
  • .dockerignore (modified, +10/-0)
  • .gitattributes (modified, +2/-0)
  • .github/FUNDING.yml (removed, +0/-1)
  • .github/ISSUE_TEMPLATE/bug_report.yml (modified, +48/-6)
  • .github/ISSUE_TEMPLATE/config.yml (modified, +2/-2)
  • .github/ISSUE_TEMPLATE/feature_request.yml (modified, +1/-1)
  • .github/actionlint.yaml (modified, +8/-2)
  • .github/actions/ensure-base-commit/action.yml (added, +47/-0)
  • .github/actions/setup-node-env/action.yml (modified, +43/-13)
  • .github/actions/setup-pnpm-store-cache/action.yml (modified, +39/-4)
  • .github/codeql/codeql-javascript-typescript.yml (added, +18/-0)
  • .github/dependabot.yml (modified, +26/-12)
  • .github/labeler.yml (modified, +4/-0)
  • .github/pull_request_template.md (modified, +7/-0)
  • .github/workflows/auto-response.yml (modified, +308/-8)
  • .github/workflows/ci.yml (modified, +294/-192)
  • .github/workflows/codeql.yml (added, +137/-0)
  • .github/workflows/docker-release-phala.yml (added, +177/-0)
  • .github/workflows/docker-release.yml (modified, +223/-67)
  • .github/workflows/docker-test.yml (added, +77/-0)
  • .github/workflows/install-smoke.yml (modified, +72/-16)
  • .github/workflows/labeler.yml (modified, +297/-99)
  • .github/workflows/openclaw-npm-release.yml (added, +85/-0)
  • .github/workflows/sandbox-common-smoke.yml (modified, +8/-2)
  • .github/workflows/stale.yml (modified, +172/-6)
  • .github/workflows/workflow-sanity.yml (modified, +30/-2)
  • .gitignore (modified, +42/-0)
  • .jscpd.json (added, +16/-0)
  • .mailmap (added, +13/-0)
  • .npmignore (added, +1/-0)
  • .npmrc (modified, +1/-1)
  • .oxfmtrc.jsonc (modified, +5/-0)
  • .pi/extensions/diff.ts (modified, +11/-89)
  • .pi/extensions/files.ts (modified, +22/-82)
  • .pi/extensions/prompt-url-widget.ts (modified, +13/-16)
  • .pi/extensions/ui/paged-select.ts (added, +82/-0)
  • .pi/prompts/landpr.md (modified, +5/-5)
  • .pi/prompts/reviewpr.md (modified, +37/-8)
  • .pre-commit-config.yaml (modified, +54/-2)
  • .secrets.baseline (modified, +229/-316)
  • .swiftformat (modified, +1/-1)
  • .swiftlint.yml (modified, +3/-1)
  • AGENTS.md (modified, +96/-0)
  • CHANGELOG.md (modified, +2104/-92)
  • CLAUDE.md (modified, +1/-1)
  • CONTRIBUTING.md (modified, +57/-4)
  • Dockerfile (modified, +221/-29)
  • Dockerfile.sandbox (modified, +8/-4)
  • Dockerfile.sandbox-browser (modified, +9/-6)
  • Dockerfile.sandbox-common (modified, +7/-4)
  • README.md (modified, +77/-68)
  • SECURITY.md (modified, +179/-3)
  • Swabble/Sources/SwabbleKit/WakeWordGate.swift (modified, +7/-13)
  • Swabble/Tests/SwabbleKitTests/WakeWordGateTests.swift (modified, +19/-0)
  • appcast.xml (modified, +206/-271)
  • apps/android/README.md (modified, +192/-11)
  • apps/android/THIRD_PARTY_LICENSES/MANROPE_OFL.txt (added, +93/-0)
  • apps/android/app/build.gradle.kts (modified, +235/-123)
  • apps/android/app/proguard-rules.pro (modified, +0/-20)
  • apps/android/app/src/main/AndroidManifest.xml (modified, +21/-9)
  • apps/android/app/src/main/java/ai/openclaw/android/InstallResultReceiver.kt (removed, +0/-33)
  • apps/android/app/src/main/java/ai/openclaw/android/MainActivity.kt (removed, +0/-130)
  • apps/android/app/src/main/java/ai/openclaw/android/MainViewModel.kt (removed, +0/-188)
  • apps/android/app/src/main/java/ai/openclaw/android/NodeApp.kt (removed, +0/-37)
  • apps/android/app/src/main/java/ai/openclaw/android/NodeForegroundService.kt (removed, +0/-180)
  • apps/android/app/src/main/java/ai/openclaw/android/NodeRuntime.kt (removed, +0/-753)
  • apps/android/app/src/main/java/ai/openclaw/android/ScreenCaptureRequester.kt (removed, +0/-65)
  • apps/android/app/src/main/java/ai/openclaw/android/SecurePrefs.kt (removed, +0/-285)
  • apps/android/app/src/main/java/ai/openclaw/android/gateway/DeviceAuthStore.kt (removed, +0/-26)
  • apps/android/app/src/main/java/ai/openclaw/android/gateway/GatewayProtocol.kt (removed, +0/-3)
  • apps/android/app/src/main/java/ai/openclaw/android/gateway/GatewaySession.kt (removed, +0/-704)
  • apps/android/app/src/main/java/ai/openclaw/android/node/AppUpdateHandler.kt (removed, +0/-295)
  • apps/android/app/src/main/java/ai/openclaw/android/node/CameraHandler.kt (removed, +0/-157)
  • apps/android/app/src/main/java/ai/openclaw/android/node/ConnectionManager.kt (removed, +0/-188)
  • apps/android/app/src/main/java/ai/openclaw/android/node/InvokeDispatcher.kt (removed, +0/-176)
  • apps/android/app/src/main/java/ai/openclaw/android/node/NodeUtils.kt (removed, +0/-57)
  • apps/android/app/src/main/java/ai/openclaw/android/node/ScreenHandler.kt (removed, +0/-25)
  • apps/android/app/src/main/java/ai/openclaw/android/node/ScreenRecordManager.kt (removed, +0/-199)
  • apps/android/app/src/main/java/ai/openclaw/android/protocol/OpenClawProtocolConstants.kt (removed, +0/-71)
  • apps/android/app/src/main/java/ai/openclaw/android/ui/ChatSheet.kt (removed, +0/-10)
  • apps/android/app/src/main/java/ai/openclaw/android/ui/RootScreen.kt (removed, +0/-429)
  • apps/android/app/src/main/java/ai/openclaw/android/ui/SettingsSheet.kt (removed, +0/-723)
  • apps/android/app/src/main/java/ai/openclaw/android/ui/StatusPill.kt (removed, +0/-114)

PR #79: feat(sessions): auto-generate session title after first exchange

Description (problem / solution / changelog)

Summary

  • Auto-generate a concise LLM-powered session title after the first user+assistant exchange
  • Write the title to the session's label field via sessions.patch RPC (auto-broadcasts WS notification to frontend)
  • Add label to deriveSessionTitle() priority chain so titles appear in TUI/ACP/WebChat

How it works

  1. After the first successful user reply in attempt.ts, a fire-and-forget call triggers maybeGenerateSessionTitle()
  2. Guard checks: only trigger === "user", first exchange (assistantCount === 1), no existing label, not subagent/temp/cron
  3. Uses prepareSimpleCompletionModelForAgent for a lightweight one-shot LLM call (no full agent runtime, no recursion risk)
  4. Prompt instructs: "Generate title in the same language as the user's message"
  5. Writes label via callGateway("sessions.patch") — uniqueness collision retries with (HH:MM) suffix

Files

FileChange
src/agents/session-auto-title.tsNew — core logic
src/agents/session-auto-title.test.tsNew — 23 tests
src/agents/simple-completion-runtime.tsPorted from upstream — lightweight LLM API
src/agents/github-copilot-token.tsPorted from upstream — dep of above
src/gateway/session-utils.ts+4 lines — label in deriveSessionTitle
src/gateway/session-utils.test.ts+18 lines — label priority tests
src/agents/pi-embedded-runner/run/attempt.ts+15 lines — fire-and-forget wiring

Test plan

  • 23 unit tests covering guards, prompt building, title cleaning, collision retry, integration
  • pnpm test -- src/agents/session-auto-title.test.ts — all pass
  • pnpm tsgo — zero type errors on touched files
  • pnpm format — clean
  • Manual: start a new session, send one message, verify label appears in session list

Ref: openclaw/openclaw#56308

🤖 Generated with Claude Code

Changed files

  • src/agents/github-copilot-token.ts (added, +138/-0)
  • src/agents/pi-embedded-runner/run/attempt.ts (modified, +27/-0)
  • src/agents/session-auto-title.test.ts (added, +297/-0)
  • src/agents/session-auto-title.ts (added, +202/-0)
  • src/agents/simple-completion-runtime.ts (added, +245/-0)
  • src/gateway/session-utils.test.ts (modified, +27/-0)
  • src/gateway/session-utils.ts (modified, +4/-0)

Code Example

Kind   Key                        Age       Model          Tokens
direct agent:main:main            1m ago    glm-5          66k/98k
direct agent:main:whats...153616  8h ago    glm-5          18k/98k

---

/title OpenClaw multi-agent configuration
RAW_BUFFERClick to expand / collapse

Problem

Currently, sessions are displayed with technical IDs like agent:main:main and UUIDs. This makes it hard to identify what a session was about at a glance.

Example from openclaw sessions:

Kind   Key                        Age       Model          Tokens
direct agent:main:main            1m ago    glm-5          66k/98k
direct agent:main:whats...153616  8h ago    glm-5          18k/98k

Proposed Solution

  1. Auto-generated summary: Generate a brief title/summary when a session ends or reaches a certain length.
  2. Manual title: Allow users to set a title with a slash command like /title OpenClaw multi-agent setup.
  3. Display in session list: Show the title in openclaw sessions output.

Example Usage

/title OpenClaw multi-agent configuration

Benefits

  • Easier to find and resume past conversations
  • Better overview of session history
  • More user-friendly than UUIDs

extent analysis

Fix Plan

To implement the proposed solution, we will focus on the following steps:

  • Auto-generate a summary when a session ends or reaches a certain length
  • Allow users to set a title with a slash command
  • Display the title in the openclaw sessions output

Code Changes

We will need to modify the existing code to include the following functionality:

Auto-generated Summary

def generate_summary(session):
    # Generate a brief title/summary based on the session content
    summary = f"Session with {session.model} model"
    return summary

Manual Title

def set_title(session, title):
    # Set a title for the session
    session.title = title
    return session

Display Title in Session List

def display_sessions(sessions):
    # Display the sessions with their titles
    for session in sessions:
        if session.title:
            print(f"Kind   Key                        Age       Model          Tokens  Title")
            print(f"direct {session.key}            {session.age}    {session.model}          {session.tokens}  {session.title}")
        else:
            print(f"Kind   Key                        Age       Model          Tokens")
            print(f"direct {session.key}            {session.age}    {session.model}          {session.tokens}")

Slash Command Handler

def handle_slash_command(command, session):
    # Handle the /title slash command
    if command.startswith("/title"):
        title = command.split(" ", 1)[1]
        session = set_title(session, title)
        return session

Verification

To verify that the fix worked, you can test the following scenarios:

  • Start a new session and let it run for a certain length of time to trigger the auto-generated summary
  • Use the /title slash command to set a title for a session
  • Run the openclaw sessions command to display the sessions with their titles

Extra Tips

  • Make sure to update the session model to include a title field
  • Consider adding a character limit for the title to prevent it from being too long
  • You can customize the auto-generated summary to include more information about the session, such as the model used or the number of tokens processed.

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