openclaw - ✅(Solved) Fix [Bug]: 'main' session is missing from the dropdown menu (only 'heartbeat' is visible) [1 pull requests, 1 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#43737Fetched 2026-04-08 00:17:42
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3labeled ×2commented ×1

I have noticed that the main session is no longer available in the session selection dropdown. This issue has persisted for the past few versions. Currently, when I open the dropdown menu, only the heartbeat session is listed.

Root Cause

I have noticed that the main session is no longer available in the session selection dropdown. This issue has persisted for the past few versions. Currently, when I open the dropdown menu, only the heartbeat session is listed.

Fix Action

Fixed

PR fix notes

PR #43746: UI: keep main session visible in chat session dropdown

Description (problem / solution / changelog)

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: chat session dropdown could omit the main session when hello.snapshot.sessionDefaults was unavailable and sessions.list only contained heartbeat/active sessions.
  • Why it matters: users can get stuck with only heartbeat visible and cannot switch back to the main session from the web UI.
  • What changed: made resolveMainSessionKey resilient by inferring canonical main keys (global or agent:<id>:main) and falling back to main instead of null.
  • What did NOT change (scope boundary): no gateway/session-store protocol changes; fix is UI dropdown key resolution only.

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 #43737
  • Related #

User-visible / Behavior Changes

  • Chat session dropdown always includes a main-session option even when active-session filtering only returns heartbeat.

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)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS (dev)
  • Runtime/container: pnpm workspace
  • Model/provider: N/A (UI logic)
  • Integration/channel (if any): Control UI chat session selector
  • Relevant config (redacted): default session config

Steps

  1. Open Control UI chat page with active-session list containing heartbeat but no explicit main row.
  2. Open the session dropdown.
  3. Verify main session option is still shown.

Expected

  • Main session remains selectable alongside heartbeat.

Actual

  • Before fix, main could be missing when fallback resolution returned null.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Focused checks run:

  • pnpm --dir ui exec oxfmt --check src/ui/app-render.helpers.ts src/ui/app-render.helpers.node.test.ts
  • pnpm --dir ui exec vitest run --config vitest.config.ts src/ui/app-render.helpers.node.test.ts ✅ (39 passed)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: added regression coverage for snapshot-provided main key, inferred canonical main key, and fallback-to-main path.
  • Edge cases checked: sessions list containing only heartbeat now still resolves a main option.
  • What you did not verify: full browser/manual UI click-through against a live gateway instance.

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.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert this PR commit.
  • Files/config to restore: ui/src/ui/app-render.helpers.ts.
  • Known bad symptoms reviewers should watch for: duplicated/incorrect main option labels in unusual custom main-key configs.

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: fallback to main could show an alias label instead of canonical key in edge configs without snapshot data.
    • Mitigation: prefer snapshot value first, then inferred canonical session keys from sessions.list; fallback only as last resort.

Changed files

  • ui/src/ui/app-render.helpers.node.test.ts (modified, +92/-0)
  • ui/src/ui/app-render.helpers.ts (modified, +17/-2)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

I have noticed that the main session is no longer available in the session selection dropdown. This issue has persisted for the past few versions. Currently, when I open the dropdown menu, only the heartbeat session is listed.

Steps to reproduce

Open the OpenClaw web interface.

Click on the session selection dropdown menu at the top.

Observe the available options.

Expected behavior

The main session (and potentially other active sessions) should be visible and selectable in the dropdown menu alongside heartbeat.

Actual behavior

The dropdown menu only displays heartbeat. The main session is completely missing.

OpenClaw version

2026.3.11

Operating system

ubuntu

Install method

No response

Model

gemini

Provider / routing chain

Direct -> Google Gemini API

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Summary

Problem: The UI dropdown only shows the heartbeat session because the backend API (or the frontend filter) now returns/keeps only that session.
Fix: Restore the original “list‑all‑active‑sessions” logic and remove the accidental filter that drops the main session.


Step‑by‑Step Fix Plan

1. Identify the API endpoint used by the dropdown

Typical path in OpenClaw: GET /api/v1/sessions (implemented in src/api/sessions.py or similar).

2. Backend – correct the session query

a. Python / Flask (SQLAlchemy) example

# src/api/sessions.py
@bp.route("/sessions", methods=["GET"])
def list_sessions():
    # OLD (regression) – only returns heartbeat sessions
    # sessions = SessionModel.query.filter_by(type="heartbeat", active=True).all()

    # NEW – return **all** active sessions (heartbeat + main + any others)
    sessions = SessionModel.query.filter_by(active=True).all()

    # Optional: keep heartbeat first for UI convenience
    sessions.sort(key=lambda s: 0 if s.type == "heartbeat" else 1)

    return jsonify([s.to_dict() for s in sessions])

b. Node / Express (MongoDB) example

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 main session (and potentially other active sessions) should be visible and selectable in the dropdown menu alongside heartbeat.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING