openclaw - ✅(Solved) Fix sessions.list returns phantom store-key entry with null updatedAt and no sessionId [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#57376Fetched 2026-04-08 01:50:30
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

sessions.list returns a phantom entry whose key matches the agent's sessions store path (e.g. agent:sean:sessions) with updatedAt: null and no sessionId or origin. This appears to be a store-level placeholder leaking into the session list response.

Root Cause

sessions.list returns a phantom entry whose key matches the agent's sessions store path (e.g. agent:sean:sessions) with updatedAt: null and no sessionId or origin. This appears to be a store-level placeholder leaking into the session list response.

Fix Action

Fix / Workaround

  • Shows up as a blank/broken entry in the built-in Control UI
  • Requires client-side filtering workaround (s.sessionId && s.updatedAt !== null) to hide

PR fix notes

PR #57419: fix(gateway): filter phantom store-key entries from sessions.list

Description (problem / solution / changelog)

Summary

sessions.list returns a phantom entry whose key matches the agent's sessions store path (e.g. agent:sean:sessions) with updatedAt: null and no sessionId. This is a store-level placeholder leaking into the session list response.

Changes

Added a filter in listSessionsFromStore to exclude entries whose key ends with :sessions and have updatedAt == null, as these are store-level metadata keys, not real sessions.

Impact

  • Removes broken/blank entries from the Control UI
  • Eliminates need for client-side filtering workaround

Fixes #57376

Changed files

  • openclaw-2026-03-30.log (added, +151/-0)
  • src/gateway/session-utils.ts (modified, +6/-1)

Code Example

{
  "key": "agent:sean:sessions",
  "kind": "direct",
  "updatedAt": null,
  "totalTokensFresh": false,
  "modelProvider": "anthropic",
  "model": "claude-sonnet-4-6",
  "contextTokens": 1000000
}
RAW_BUFFERClick to expand / collapse

Description

sessions.list returns a phantom entry whose key matches the agent's sessions store path (e.g. agent:sean:sessions) with updatedAt: null and no sessionId or origin. This appears to be a store-level placeholder leaking into the session list response.

Repro

Call sessions.list with agentId: "sean" (or any agent with at least one real session). The response includes a phantom entry:

{
  "key": "agent:sean:sessions",
  "kind": "direct",
  "updatedAt": null,
  "totalTokensFresh": false,
  "modelProvider": "anthropic",
  "model": "claude-sonnet-4-6",
  "contextTokens": 1000000
}

No sessionId, no origin, no displayName, updatedAt: null.

Expected

Only real sessions with a sessionId and activity should be returned. Store-level keys should not appear in the list.

Impact

  • Shows up as a blank/broken entry in the built-in Control UI
  • Requires client-side filtering workaround (s.sessionId && s.updatedAt !== null) to hide

Environment

  • OpenClaw 2026.3.28
  • macOS 26.4 arm64

extent analysis

Fix Plan

To resolve the issue of a phantom entry appearing in the sessions.list response, we need to modify the backend logic to filter out store-level placeholder entries.

Code Changes

We will add a check to ensure that only sessions with a valid sessionId and non-null updatedAt value are included in the response.

def get_sessions(agent_id):
    # Existing code to retrieve sessions
    sessions = sessions_store.list(agent_id)
    
    # Filter out phantom entries
    filtered_sessions = [s for s in sessions if s.get('sessionId') and s.get('updatedAt') is not None]
    
    return filtered_sessions

Alternatively, if you're using a database query to retrieve sessions, you can modify the query to exclude rows with null updatedAt values and no sessionId.

SELECT * FROM sessions
WHERE agent_id = 'sean' AND session_id IS NOT NULL AND updated_at IS NOT NULL;

Verification

To verify that the fix worked, call the sessions.list endpoint with the same agentId and check that the response no longer includes the phantom entry. The response should only contain real sessions with a sessionId and non-null updatedAt value.

Extra Tips

  • Make sure to test the fix thoroughly to ensure that it doesn't introduce any new issues or affect the functionality of other features.
  • Consider adding additional logging or monitoring to detect and prevent similar issues in the future.

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