openclaw - ✅(Solved) Fix Control UI agent switcher shows raw session key instead of agent display name for non-default agents [1 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#70610Fetched 2026-04-24 05:55:46
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

In Control UI (left sidebar agent switcher), non-default agents display the raw internal session key format instead of the configured display name.

Expected: 旺财(lottery)/main Actual: webchat:g-agent-lottery-main

Root Cause

In Control UI (left sidebar agent switcher), non-default agents display the raw internal session key format instead of the configured display name.

Expected: 旺财(lottery)/main Actual: webchat:g-agent-lottery-main

Fix Action

Fixed

PR fix notes

PR #70636: fix(ui): show agent display name for channel-prefixed session keys in switcher

Description (problem / solution / changelog)

Problem

Closes #70610

Non-default agents accessed via channel plugins (e.g. webchat) appear in the session list under a legacy channel-prefixed key like webchat:g-agent-lottery-main instead of the canonical agent:lottery:main format. parseAgentSessionKey returns null for these keys, so the session switcher placed them in the "Other Sessions" group and used the raw key as the label:

Expected旺财(lottery)/main
Actualwebchat:g-agent-lottery-main

Root Cause

In resolveSessionOptionGroups → addOption:

// Before — single parse attempt
const parsed = parseAgentSessionKey(key);
// null for webchat:g-agent-lottery-main → raw key used as label

Fix

Add tryParseChannelAgentKey(key, agents) that matches the {channel}:g-agent-{agentId}-{rest} pattern against the known agents list (sorted longest-first to avoid prefix collisions), returning a ParsedAgentSessionKey when a match is found.

addOption falls back to this function when parseAgentSessionKey returns null:

// After — fallback for channel-prefixed keys
const parsed =
  parseAgentSessionKey(key) ??
  tryParseChannelAgentKey(key, state.agentsList?.agents ?? []);

The original key is preserved as the option value so session switching continues to work. Only the display routing changes: the session is now placed in the correct agent group with the configured name (旺财 (lottery)) and the rest segment (main) as the option label.

Tests Added

resolveSessionOptionGroups — channel agent key fallback (#70610):

  • routes webchat:g-agent-{id}-{rest} to the correct agent group
  • leaves unmatched channel keys in Other Sessions (safe fallback)
  • prefers canonical agent: key over fallback parsing (no regression)

Changed files

  • ui/src/ui/app-render.helpers.node.test.ts (modified, +105/-0)
  • ui/src/ui/app-render.helpers.ts (modified, +43/-2)

Code Example

{
  "id": "lottery",
  "name": "旺财",
  "identity": {
    "name": "旺财",
    "emoji": "🐕",
    "theme": "从心的彩票专家"
  }
}
RAW_BUFFERClick to expand / collapse

Description

In Control UI (left sidebar agent switcher), non-default agents display the raw internal session key format instead of the configured display name.

Expected: 旺财(lottery)/main Actual: webchat:g-agent-lottery-main

Environment

  • OpenClaw version: 2026.4.21 (f788c88)
  • OS: macOS (arm64, Darwin 25.4.0)
  • Browser: Control UI webchat

Agent Configuration (openclaw.json)

The lottery agent is correctly configured:

{
  "id": "lottery",
  "name": "旺财",
  "identity": {
    "name": "旺财",
    "emoji": "🐕",
    "theme": "从心的彩票专家"
  }
}

Session Registry

agents/lottery/sessions/sessions.json contains only the correct key:

  • agent:lottery:main

Steps to Reproduce

  1. Configure a multi-agent setup with a non-default agent (e.g., "lottery")
  2. Open Control UI
  3. Look at the agent switcher dropdown
  4. Non-default agent shows webchat:g-agent-lottery-main instead of 旺财(lottery)/main

Notes

  • Default agent (main) displays correctly as 傻狗(main)/main
  • Only non-default agents are affected
  • Browser cache clear (Cmd+Shift+R) does not fix the issue

extent analysis

TL;DR

The issue can be fixed by updating the agent display name in the Control UI to use the configured display name from the openclaw.json file.

Guidance

  • Verify that the openclaw.json file is correctly formatted and the name field is set for the non-default agent.
  • Check the Session Registry to ensure that the correct key is being used for the non-default agent.
  • Investigate the Control UI code to determine why it is displaying the raw internal session key format instead of the configured display name.
  • Consider adding a mapping or translation layer in the Control UI to correctly display the agent names.

Example

No code snippet is provided as the issue does not contain enough information about the Control UI code.

Notes

The issue seems to be specific to non-default agents and the Control UI. The default agent is displayed correctly, which suggests that the issue is not with the openclaw.json file or the Session Registry.

Recommendation

Apply a workaround by updating the Control UI to use the configured display name from the openclaw.json file, as the root cause of the issue is likely due to the Control UI not correctly handling non-default agent names.

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