openclaw - 💡(How to fix) Fix Control UI should always surface the canonical main session in the chat dropdown [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#72543Fetched 2026-04-28 06:34:43
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

The Control UI chat session dropdown does not reliably surface the canonical main session. In practice, a user can end up without an obvious main / assistant session target in the dropdown, even though the canonical session exists as agent:main:main.

For direct assistant use, there should always be a stable pinned entry such as:

  • Chelmsworth (main) /main

that maps to:

  • agent:main:main

Root Cause

For users who treat the main assistant as a persistent persona, the dropdown is effectively the primary routing control. If the canonical main session is missing or inconsistently represented, the UI creates avoidable confusion and makes it harder to reliably return to the main assistant.

Fix Action

Fix / Workaround

Local hotfix that worked

I validated a local compiled-bundle patch against the installed Control UI asset:

The working patch did two things:

Code Example

const CANONICAL_MAIN_SESSION_KEY = "agent:main:main";

function normalizeMainSessionKey(key?: string, ctx?: { mainSessionKey?: string; mainKey?: string; defaultAgentId?: string }) {
  const canonical = ctx?.mainSessionKey ?? CANONICAL_MAIN_SESSION_KEY;
  if (!key) return canonical;
  if (
    key === "main" ||
    key === (ctx?.mainKey ?? "main") ||
    key === CANONICAL_MAIN_SESSION_KEY ||
    key === `agent:${ctx?.defaultAgentId}:main` ||
    key === `agent:${ctx?.defaultAgentId}:${ctx?.mainKey ?? "main"}`
  ) {
    return canonical;
  }
  return key;
}

function buildSessionOptions(...) {
  addOption({
    key: CANONICAL_MAIN_SESSION_KEY,
    label: "Chelmsworth (main) /main",
    pinned: true,
  });

  // then merge in discovered sessions as usual
}
RAW_BUFFERClick to expand / collapse

Summary

The Control UI chat session dropdown does not reliably surface the canonical main session. In practice, a user can end up without an obvious main / assistant session target in the dropdown, even though the canonical session exists as agent:main:main.

For direct assistant use, there should always be a stable pinned entry such as:

  • Chelmsworth (main) /main

that maps to:

  • agent:main:main

Why this matters

For users who treat the main assistant as a persistent persona, the dropdown is effectively the primary routing control. If the canonical main session is missing or inconsistently represented, the UI creates avoidable confusion and makes it harder to reliably return to the main assistant.

Current behavior

  • The canonical main session may exist and be active.
  • The Control UI does not always expose it as a stable, obvious option in the chat session dropdown.
  • Session aliases like main may not normalize to the canonical session key in a way that guarantees consistent dropdown behavior.

Expected behavior

The chat session dropdown should always include a pinned canonical main-session option:

  • label: Chelmsworth (main) /main (or a generic equivalent if the product wants neutral naming)
  • key: agent:main:main

Additionally, plain main should normalize to the canonical key so the UI state, persisted settings, and dropdown selection stay aligned.

Proposed fix

In the Control UI session dropdown logic:

  1. Always inject agent:main:main into the available session options
  2. Render it with a pinned/stable label, for example:
    • Chelmsworth (main) /main
  3. Normalize main and equivalent aliases to agent:main:main
  4. Apply the same normalization to:
    • current selected session
    • persisted settings.sessionKey
    • persisted settings.lastActiveSessionKey

Local hotfix that worked

I validated a local compiled-bundle patch against the installed Control UI asset:

  • file: /opt/homebrew/lib/node_modules/openclaw/dist/control-ui/assets/index-Dts6VHgr.js

The working patch did two things:

  1. In session normalization logic, defaulted missing/alias main values to agent:main:main
  2. In the dropdown builder, always injected agent:main:main and labeled it Chelmsworth (main) /main

Suggested implementation direction

A source-level fix should likely live near the Control UI chat session option builder and the session-key normalization helpers, rather than in compiled dist output.

Pseudocode:

const CANONICAL_MAIN_SESSION_KEY = "agent:main:main";

function normalizeMainSessionKey(key?: string, ctx?: { mainSessionKey?: string; mainKey?: string; defaultAgentId?: string }) {
  const canonical = ctx?.mainSessionKey ?? CANONICAL_MAIN_SESSION_KEY;
  if (!key) return canonical;
  if (
    key === "main" ||
    key === (ctx?.mainKey ?? "main") ||
    key === CANONICAL_MAIN_SESSION_KEY ||
    key === `agent:${ctx?.defaultAgentId}:main` ||
    key === `agent:${ctx?.defaultAgentId}:${ctx?.mainKey ?? "main"}`
  ) {
    return canonical;
  }
  return key;
}

function buildSessionOptions(...) {
  addOption({
    key: CANONICAL_MAIN_SESSION_KEY,
    label: "Chelmsworth (main) /main",
    pinned: true,
  });

  // then merge in discovered sessions as usual
}

Version observed

  • openclaw npm package version: 2026.4.9

Repro notes

Observed in a live local install where the main session existed and was active, but the desired stable main-session dropdown affordance was not guaranteed.

extent analysis

TL;DR

The Control UI chat session dropdown can be fixed by always injecting the canonical main session key and normalizing aliases to it.

Guidance

  • Review the session normalization logic to ensure it defaults missing or alias "main" values to the canonical main session key (agent:main:main).
  • Verify that the dropdown builder always includes the canonical main session key with a pinned and stable label.
  • Check the normalizeMainSessionKey function to ensure it correctly handles various input scenarios and returns the canonical key when necessary.
  • Consider implementing a source-level fix near the Control UI chat session option builder and session-key normalization helpers.

Example

const CANONICAL_MAIN_SESSION_KEY = "agent:main:main";

function normalizeMainSessionKey(key?: string, ctx?: { mainSessionKey?: string; mainKey?: string; defaultAgentId?: string }) {
  const canonical = ctx?.mainSessionKey ?? CANONICAL_MAIN_SESSION_KEY;
  if (!key) return canonical;
  if (
    key === "main" ||
    key === (ctx?.mainKey ?? "main") ||
    key === CANONICAL_MAIN_SESSION_KEY ||
    key === `agent:${ctx?.defaultAgentId}:main` ||
    key === `agent:${ctx?.defaultAgentId}:${ctx?.mainKey ?? "main"}`
  ) {
    return canonical;
  }
  return key;
}

Notes

The provided pseudocode and local hotfix suggest a viable solution direction, but a thorough review of the Control UI codebase is necessary to ensure a comprehensive fix.

Recommendation

Apply the suggested implementation direction, which involves modifying the session normalization logic and dropdown builder to always include the canonical main session key. This approach should provide a stable and reliable solution for the issue.

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…

FAQ

Expected behavior

The chat session dropdown should always include a pinned canonical main-session option:

  • label: Chelmsworth (main) /main (or a generic equivalent if the product wants neutral naming)
  • key: agent:main:main

Additionally, plain main should normalize to the canonical key so the UI state, persisted settings, and dropdown selection stay aligned.

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 - 💡(How to fix) Fix Control UI should always surface the canonical main session in the chat dropdown [1 participants]