openclaw - ✅(Solved) Fix [Bug]: sessions_list API only returns main session — all other sessions missing from dashboard and API [1 pull requests, 2 comments, 3 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#54435Fetched 2026-04-08 01:27:34
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2cross-referenced ×1labeled ×1

PR fix notes

PR #54716: Fix sessions.list for literal per-agent store paths

Description (problem / solution / changelog)

Summary

  • treat literal session.store paths under agents/<id>/sessions/sessions.json as multi-agent discovery roots instead of single-store fallbacks
  • keep the old single-store behavior for literal paths that do not match the per-agent on-disk layout
  • add a regression covering the exact .../agents/main/sessions/sessions.json configuration from #54435

Validation

  • pnpm exec oxfmt src/gateway/session-utils.ts src/gateway/session-utils.test.ts
  • pnpm exec oxlint --type-aware src/gateway/session-utils.ts src/gateway/session-utils.test.ts
  • pnpm exec vitest --run src/gateway/session-utils.test.ts -t "loadCombinedSessionStoreForGateway includes disk-only agents" (run twice)
  • API-backed proof script on main before the fix: sessions.list returned count=1
  • Same API-backed proof script on this branch after the fix: sessions.list returned count=2

Proof artifacts

Closes #54435.

Changed files

  • src/gateway/session-utils.subagent.test.ts (modified, +82/-0)
  • src/gateway/session-utils.ts (modified, +37/-5)

Code Example

{
  "count": 1,
  "sessions": [
    { "key": "agent:main:main", "channel": "webchat", ... }
  ]
}

### OpenClaw version

2026-3-23-2

### Operating system

macOS TAHOE

### Install method

_No response_

### Model

claude sonnet 4.5

### Provider / routing chain

webchat (main session), Telegram

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Bug Description

sessions_list API only returns the main session. All other sessions (e.g. Telegram session, any newly created sessions) are missing from both the Control UI dashboard and the API response.

Environment

  • OS: macOS (Apple M4 Mac mini, 32GB RAM)
  • Node.js: v25.8.1
  • OpenClaw version: 2026.3.23-2 (confirmed latest)
  • Install method: npm global (/opt/homebrew/lib/node_modules/openclaw)

Steps to reproduce

  1. Start OpenClaw with multiple sessions configured (e.g. main + Telegram)
  2. Open Control UI → Sessions
  3. Observe: only the main session is listed
  4. Call sessions_list API directly
  5. Observe: only 1 session returned despite multiple active sessions

Expected behavior

All active sessions (main, Telegram, newly created sessions, etc.) should appear in both the dashboard and sessions_list API response.

Actual behavior

Only the main session is returned:

{
  "count": 1,
  "sessions": [
    { "key": "agent:main:main", "channel": "webchat", ... }
  ]
}

### OpenClaw version

2026-3-23-2

### Operating system

macOS TAHOE

### Install method

_No response_

### Model

claude sonnet 4.5

### Provider / routing chain

webchat (main session), Telegram

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

Sessions themselves work correctly — chat functions normally The chat UI shows "new session started" messages when sessions are created Gateway restart does not resolve the issue Newly spawned sessions also disappear from the dashboard after creation This causes a compounding problem: if the agent opens a new session to investigate, the previous sessions vanish from the dashboard and the agent loses continuity

extent analysis

Fix Plan

To resolve the issue of missing sessions in the sessions_list API and Control UI dashboard, we need to update the session retrieval logic. The fix involves modifying the sessions_list API to fetch all active sessions, including those that are not the main session.

Steps to Fix:

  • Update the sessions_list API to query all active sessions.
  • Modify the session filtering logic to include all session types (e.g., main, Telegram, newly created sessions).

Example Code:

// Update sessions_list API to fetch all active sessions
app.get('/sessions_list', async (req, res) => {
  const sessions = await Session.findAll({ where: { active: true } });
  res.json({ count: sessions.length, sessions: sessions.map(session => session.toJSON()) });
});

Verification

To verify that the fix worked, follow these steps:

  • Restart the OpenClaw server.
  • Call the sessions_list API directly.
  • Check the Control UI dashboard → Sessions.
  • Verify that all active sessions (main, Telegram, newly created sessions, etc.) are listed in both the API response and the dashboard.

Extra Tips

  • Ensure that the Session model is correctly defined and that the findAll method is properly implemented.
  • If using a caching mechanism, clear the cache after updating the sessions_list API to ensure that the latest changes are reflected.
  • Test the fix with different session types and scenarios to ensure that all active sessions are correctly retrieved and displayed.

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

All active sessions (main, Telegram, newly created sessions, etc.) should appear in both the dashboard and sessions_list API response.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING