openclaw - ✅(Solved) Fix [Feature]: Custom Session Names/Labels [1 pull requests, 2 comments, 2 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#55555Fetched 2026-04-08 01:38:06
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×1labeled ×1

Add ability to assign custom names/labels to sessions in the dashboard

Root Cause

Add ability to assign custom names/labels to sessions in the dashboard

PR fix notes

PR #57246: Feature custom session names/labels

Description (problem / solution / changelog)

Summary

  • Problem: Sessions can already have a friendly label, but the UI and openclaw sessions still center the long session key, and there was no simple CLI to set or clear a label, so you keep copying ugly keys even when a name is saved.
  • Why it matters: Operators use the control UI and openclaw sessions to triage many sessions; friendly labels reduce mistakes and speed up navigation.
  • What changed:
    • Added openclaw sessions label (alias rename) to set or clear a label with --session, using existing sessions.patch (--clear clears the label).
    • Added --force to allow patching an unknown session key (explicit escape hatch; avoids accidental phantom sessions by default).
    • Updated docs/cli/sessions.md for the new command and flags.
    • openclaw sessions text table and JSON now include label / display-name fields.
    • Control UI sessions table uses the display name for the main link; shows the raw key when it differs; aria-label avoids redundant key (key) when the label matches the key.
    • Sessions filter matches the same resolved display title as the key column (search matches what users see; unit test added).
    • Key column sorting matches the same resolved display title as the key column (sort matches what users see; unit test added).
    • Tests for the CLI command and sessions UI.
    • CHANGELOG entry for the release.
  • What did NOT change (scope boundary): Did not add a new gateway feature or change how channels work; wired the existing “patch session” path into the CLI and improved how labels show up in the UI and terminal.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • 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 #55555
  • Related # (N/A)
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

N/A (not a bug/regression fix).

Regression Test Plan (if applicable)

N/A (new feature / UX surface, not a regression fix).

User-visible / Behavior Changes

  • CLI: openclaw sessions label and openclaw sessions rename (alias) to set or clear (--clear) a session label via --session <key>; now validates session key existence via sessions.list by default and requires --force to patch an unknown key; documented in docs/cli/sessions.md.
  • openclaw sessions: Text table includes label-oriented columns where applicable; JSON includes label/display fields for tooling.
  • Control UI: Sessions table shows a friendly display name when a label exists, with accessible naming on the chat link when label differs from key. Session list filter and Key sort both match the resolved display title (same string as the key column), not only raw key / label / kind / stored displayName.
  • CHANGELOG: User-facing entry added.

AI assistance

  • AI-assisted: Yes - Cursor Testing: Fully tested locally: pnpm build, pnpm ui:build, pnpm check, pnpm test, and pnpm test -- src/commands/sessions-label.test.ts ui/src/ui/views/sessions.test.ts.
  • Understanding: I reviewed the diff, ran the commands above, and can explain the behavior. I also edited and corrected several parts of the AI-suggested code after review.
  • Prompts / session logs: Used AI to understand the codebase and which files this PR touches; helped put together a local plan.md for myself, then reviewed all changes .
  • Review tooling: Local codex review --base origin/main noted the filter vs display-title gap; fixed in a follow-up commit.

UI Change Screenshots

Before the changes <img width="1407" height="669" alt="before" src="https://github.com/user-attachments/assets/eb24f0db-43de-445d-bab4-2eba56158c46" />

After Changes <img width="1407" height="669" alt="after" src="https://github.com/user-attachments/assets/4778ff73-e412-4a0d-abc8-db474e06c5d3" />

Changed files

  • CHANGELOG.md (modified, +2/-0)
  • docs/cli/sessions.md (modified, +28/-1)
  • src/cli/program/register.status-health-sessions.ts (modified, +82/-0)
  • src/commands/sessions-label.test.ts (added, +215/-0)
  • src/commands/sessions-label.ts (added, +131/-0)
  • src/commands/sessions-table.ts (modified, +23/-0)
  • src/commands/sessions.ts (modified, +6/-0)
  • ui/src/ui/views/sessions.test.ts (modified, +77/-0)
  • ui/src/ui/views/sessions.ts (modified, +26/-17)
RAW_BUFFERClick to expand / collapse

Summary

Add ability to assign custom names/labels to sessions in the dashboard

Problem to solve

Currently only subagent sessions can be labeled when spawned. Other session types (main, cron, telegram) show with auto-generated identifiers that are hard to distinguish in the dashboard. Users can't differentiate between multiple active sessions of the same type.

Proposed solution

Add a session rename CLI command and/or dashboard UI to assign custom labels to any active session:

openclaw session rename <session-id> "My Custom Name"

Also update the session API to store/return custom labels and display them in the dashboard instead of auto-generated names.

Alternatives considered

No response

Impact

• Low complexity - mostly API and UI changes • Improves usability for users with many concurrent sessions • Enables better dashboard organization without breaking existing functionality

Evidence/examples

No response

Additional information

No response

extent analysis

Fix Plan

To add the ability to assign custom names/labels to sessions in the dashboard, we will implement the following steps:

  • Add a rename command to the CLI
  • Update the session API to store and return custom labels
  • Update the dashboard UI to display custom labels instead of auto-generated names

Code Changes

Here are some example code snippets to illustrate the changes:

# CLI command to rename a session
def rename_session(session_id, new_name):
    # Update the session API to store the new name
    session_api.update_session(session_id, {'name': new_name})

# Update the session API to store and return custom labels
class SessionAPI:
    def update_session(self, session_id, data):
        # Update the session with the new name
        session = self.get_session(session_id)
        session['name'] = data['name']
        self.save_session(session)

    def get_session(self, session_id):
        # Return the session with the custom label
        session = self.sessions.get(session_id)
        return {'id': session_id, 'name': session['name']}

# Update the dashboard UI to display custom labels
def display_sessions(sessions):
    for session in sessions:
        # Display the custom label instead of the auto-generated name
        print(f"{session['name']} ({session['id']})")

Verification

To verify that the fix worked, you can:

  • Run the openclaw session rename command to rename a session
  • Check the dashboard to see if the custom label is displayed
  • Use the session API to retrieve the session and verify that the custom label is returned

Extra Tips

  • Make sure to handle errors and edge cases when updating the session API and dashboard UI
  • Consider adding validation to ensure that custom labels are unique and follow a specific format
  • Document the new rename command and updated session API in the user documentation.

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]: Custom Session Names/Labels [1 pull requests, 2 comments, 2 participants]