openclaw - ✅(Solved) Fix Feature: Display session label in chat header (control-ui) [1 pull requests, 6 comments, 4 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#50077Fetched 2026-04-08 00:59:24
View on GitHub
Comments
6
Participants
4
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×6cross-referenced ×1

When navigating to a session chat in the control-ui, the header only shows the raw session key (e.g., agent:main:subagent:0c94dade-2899-4e11-ae0c-4aa8e6f085ba). Even when a label is set via sessions.patch, it is not displayed in the chat view header — only in the Sessions list table.

This makes it very difficult to identify which conversation you are currently viewing, especially when returning to previous sessions.

Root Cause

When navigating to a session chat in the control-ui, the header only shows the raw session key (e.g., agent:main:subagent:0c94dade-2899-4e11-ae0c-4aa8e6f085ba). Even when a label is set via sessions.patch, it is not displayed in the chat view header — only in the Sessions list table.

This makes it very difficult to identify which conversation you are currently viewing, especially when returning to previous sessions.

Fix Action

Fix / Workaround

When navigating to a session chat in the control-ui, the header only shows the raw session key (e.g., agent:main:subagent:0c94dade-2899-4e11-ae0c-4aa8e6f085ba). Even when a label is set via sessions.patch, it is not displayed in the chat view header — only in the Sessions list table.

The label field (max 64 chars, unique per session) can be set via sessions.patch and is already used for filtering/searching in the Sessions tab. Displaying it in the chat view would complete the UX loop.

Auto-labeling sessions with a local LLM (analyzing conversation content to generate 3-5 word titles like "Setup Home Assistant Pi5" or "Debug Stream Deck Icons") is already possible via sessions.patch. The missing piece is seeing these labels when you click into a session chat.

PR fix notes

PR #50375: feat(control-ui): display session label in chat header

Description (problem / solution / changelog)

Summary

  • Problem: Chat view header only shows the raw session key (e.g., agent:main:subagent:0c94dade-...), even when a label is set via sessions.patch. Labels only appear in the Sessions list table.
  • Why it matters: Users who auto-label sessions (e.g., "Setup Home Assistant Pi5") cannot identify conversations at a glance in the chat view.
  • What changed: renderChatSessionSelect() in app-render.helpers.ts now checks for an explicit label or displayName on the active session and renders it as a .page-title above the session selector dropdown. The raw key is available as a tooltip.
  • What did NOT change: No label → header unchanged. Session selector dropdown behavior unchanged. No new CSS classes (reuses existing .page-title).

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #50077

User-visible / Behavior Changes

  • When a session has an explicit label or displayName set via sessions.patch, a prominent title (using .page-title styling) appears above the session selector dropdown in the chat header.
  • The raw session key is shown as a tooltip on hover.
  • Sessions without a label/displayName: no change to the header.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Linux (WSL2)
  • Runtime: Node 22, pnpm
  • Relevant config: Vite dev server + Playwright for visual verification

Steps

  1. Set a session label: sessions.patch({ key: "agent:main:subagent:...", label: "Setup Home Assistant Pi5" })
  2. Navigate to that session's chat view
  3. Observe the chat header

Expected

  • Label "Setup Home Assistant Pi5" displayed prominently above the session selector dropdown
  • Raw key shown as tooltip on hover

Actual

  • Before: Only raw key visible in the dropdown
  • After: Label title shown above dropdown ✅

Evidence

  • Screenshot/recording

Before (no label): Only the session selector dropdown with the raw key.

After (with label): Title "Subagent: Setup Home Assistant Pi5" appears above the dropdown.

After (with displayName): Title "Subagent: Debug Stream Deck Icons" appears above the dropdown.

(Visual verification performed via Playwright with a standalone test page rendering renderChatSessionSelect with mock data. Full gateway environment was not available locally.)

  • Failing test/log before + passing after

3 new unit tests added to chat.test.ts (29/29 pass):

  • shows a page-title with the session label when one is set
  • does not render a page-title when no label is set
  • shows displayName in the page-title when label is absent

Human Verification (required)

  • Verified scenarios: Label present, no label, displayName-only — all via unit tests and Playwright visual test
  • Edge cases checked: resolveSessionDisplayName() fallback name (e.g., "Main Session") correctly NOT treated as explicit label; whitespace-only labels ignored
  • What I did NOT verify: Full gateway integration (no access to running OpenClaw gateway locally). Visual verification used a standalone Playwright test page with mock state.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert: Revert the single commit; the title only renders when hasExplicitName is true, so removing the condition removes the feature entirely.
  • Known bad symptoms: Unexpected .page-title appearing for sessions without labels (would indicate hasExplicitName logic is wrong).

Risks and Mitigations

  • Risk: sessions.find() called on every render for the active session row.
    • Mitigation: Sessions array is typically small (<100 entries). Same pattern used elsewhere in the codebase (e.g., chat.ts:806).

This is an AI-assisted contribution (Claude). I have reviewed and understand all changes. Lightly tested via unit tests + Playwright visual verification (no full gateway environment available).

Changed files

  • ui/src/ui/app-render.helpers.ts (modified, +5/-0)
  • ui/src/ui/views/chat.test.ts (modified, +33/-0)
RAW_BUFFERClick to expand / collapse

Summary

When navigating to a session chat in the control-ui, the header only shows the raw session key (e.g., agent:main:subagent:0c94dade-2899-4e11-ae0c-4aa8e6f085ba). Even when a label is set via sessions.patch, it is not displayed in the chat view header — only in the Sessions list table.

This makes it very difficult to identify which conversation you are currently viewing, especially when returning to previous sessions.

Current Behavior

  • Sessions list (tab Sessions): shows key as link + label as editable input field ✅
  • Chat view (clicking into a session): shows only the raw key in the header ❌
  • The label field is already available in the session data returned by sessions.list

Expected Behavior

When viewing a session chat, the label (or displayName if set) should be prominently displayed in the chat header/topbar, either:

  • Replacing the raw key entirely, or
  • Shown above/below the key as the primary identifier

This is consistent with how ChatGPT, Claude.ai, LobeChat, and Open WebUI all display auto-generated conversation titles in their chat views.

Context

The label field (max 64 chars, unique per session) can be set via sessions.patch and is already used for filtering/searching in the Sessions tab. Displaying it in the chat view would complete the UX loop.

Use Case

Auto-labeling sessions with a local LLM (analyzing conversation content to generate 3-5 word titles like "Setup Home Assistant Pi5" or "Debug Stream Deck Icons") is already possible via sessions.patch. The missing piece is seeing these labels when you click into a session chat.

Environment

  • OpenClaw 2026.3.13
  • Control UI (built-in webchat dashboard)

extent analysis

Fix Plan

To display the session label in the chat view header, we need to modify the Control UI code. Here are the steps:

  • Update the sessions.list API to include the label field in the response.
  • Modify the chat view header template to display the label field.
  • Add a conditional statement to display the displayName field if it is set.

Example Code

// Update sessions.list API response
// Assuming sessions.list returns a JSON object with session data
const sessionData = {
  key: 'agent:main:subagent:0c94dade-2899-4e11-ae0c-4aa8e6f085ba',
  label: 'Setup Home Assistant Pi5',
  displayName: 'My Session'
};

// Modify chat view header template
const chatHeaderView = `
  <h1>
    {{#if displayName}}
      {{displayName}}
    {{else}}
      {{label}}
    {{/if}}
    <small>{{key}}</small>
  </h1>
`;

// Render the chat view header with the updated template
const chatHeader = document.getElementById('chat-header');
chatHeader.innerHTML = chatHeaderView;

Verification

To verify the fix, follow these steps:

  1. Update the Control UI code with the modified template.
  2. Restart the Control UI application.
  3. Navigate to a session chat.
  4. Verify that the session label is displayed in the chat view header.

Extra Tips

  • Make sure to test the fix with different session labels and display names to ensure that the conditional statement works correctly.
  • Consider adding a fallback display name or label if neither the label nor displayName fields are set.

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: Display session label in chat header (control-ui) [1 pull requests, 6 comments, 4 participants]