openclaw - 💡(How to fix) Fix Sessions panel: sort by last meaningful activity, live reordering [1 comments, 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#51029Fetched 2026-04-08 01:05:22
View on GitHub
Comments
1
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1locked ×1
RAW_BUFFERClick to expand / collapse

Problem

The sessions panel in the Control UI shows sessions with an updatedAt column, but the default sort is opaque — it's not immediately clear which session was most recently active. You have to manually click the "Updated" column header to sort, and it doesn't auto-refresh as events come in.

When you're working across multiple channels (#toolbagcrm, #bot-talk, DMs, heartbeats), you want to glance at the sessions list and immediately see where the most recent action is — like every messaging app does.

Goal

Sessions should auto-sort by last meaningful activity in real time, so the most recently touched session is always at the top.

Proposed Model — Three-Tier Timestamps

TimestampWhat it tracksExample events
lastEventAtAny event at allHeartbeat ack, internal bookkeeping, token updates
lastMeaningfulActivityAtStuff humans care aboutUser message, assistant reply, tool result, session spawn/resume
lastVisibleConversationAtHuman/agent conversational turns onlyUser message, assistant reply

The sessions panel should sort by lastMeaningfulActivityAt by default.

Activity Classification

Bubbles to top (meaningful):

  • Inbound user message
  • Assistant reply
  • Manual session input
  • Meaningful tool/system events
  • Session spawn/resume/handoff

Updates timestamp silently (no bubble):

  • Heartbeat ack
  • Routine polls
  • Internal bookkeeping
  • Token/status background updates

Sub-Agent Rollup

Child/sub-agent sessions should roll their activity up to the parent session:

  • Parent gets lastMeaningfulActivityAt = max(parent, children)
  • Sub-agent sessions hidden or nested/collapsed by default in the UI
  • Expandable if you want to drill in

Without this, the top of the list becomes a graveyard of anonymous coding agents pushing real conversations to slot 7.

UI

  • Default sort: lastMeaningfulActivityAt descending (most recent first)
  • Live updates: list re-sorts in real time as events arrive (WebSocket push or short polling)
  • Reason indicator: tiny label showing why a session is at the top:
    • #toolbag • user msg • 12s ago
    • DM with Tim • assistant reply • 1m ago
  • Relative timestamps: "2m ago" style for quick scanning

Suggested Incremental Approach

MVP

  1. Default sort by updatedAt descending (no manual click required)
  2. Auto-refresh or push updates so list reorders without manual refresh

V2

  1. Distinguish lastEventAt vs lastMeaningfulActivityAt
  2. Suppress heartbeat/internal noise from bubbling
  3. Roll sub-agent activity up to parent
  4. Show "why this moved" indicator

Discussed in #bot-talk by Tim, Clawd, Clive, and Quinn (2026-03-20).

extent analysis

Fix Plan

To implement the required functionality, follow these steps:

  • Update the database schema to include lastMeaningfulActivityAt and lastEventAt columns.
  • Modify the API to update these columns based on the event type.
  • Implement a WebSocket push or short polling mechanism to update the sessions list in real-time.
  • Update the UI to default sort by lastMeaningfulActivityAt descending and display relative timestamps.

Example code snippets:

# Update database schema
from sqlalchemy import Column, DateTime
class Session(Base):
    __tablename__ = 'sessions'
    last_meaningful_activity_at = Column(DateTime)
    last_event_at = Column(DateTime)

# Update API to update columns based on event type
def update_session_activity(session, event):
    if event.type in ['user_message', 'assistant_reply']:
        session.last_meaningful_activity_at = datetime.now()
    session.last_event_at = datetime.now()
    db.session.commit()

# Implement WebSocket push or short polling mechanism
from flask_socketio import SocketIO, emit
socketio = SocketIO(app)
def update_sessions_list():
    sessions = Session.query.order_by(Session.last_meaningful_activity_at.desc()).all()
    emit('update_sessions_list', [session.to_dict() for session in sessions])

# Update UI to default sort by lastMeaningfulActivityAt descending
from flask import render_template
@app.route('/sessions')
def sessions():
    sessions = Session.query.order_by(Session.last_meaningful_activity_at.desc()).all()
    return render_template('sessions.html', sessions=sessions)

Verification

To verify that the fix worked, check the following:

  • The sessions list is sorted by lastMeaningfulActivityAt descending by default.
  • The list updates in real-time as events arrive.
  • Relative timestamps are displayed correctly.
  • Sub-agent sessions are rolled up to the parent session correctly.

Extra Tips

  • Use a message queue like Celery or RabbitMQ to handle updates to the sessions list.
  • Implement caching to improve performance.
  • Use a library like Moment.js to display relative timestamps in the UI.

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

openclaw - 💡(How to fix) Fix Sessions panel: sort by last meaningful activity, live reordering [1 comments, 1 participants]