openclaw - 💡(How to fix) Fix Sessions panel: sort by last meaningful activity, not just last message [3 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#51028Fetched 2026-04-08 01:05:24
View on GitHub
Comments
3
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
commented ×3cross-referenced ×3

The sessions panel should sort sessions by last meaningful activity, not last message timestamp. Right now it's opaque — you can't tell why a session is at the top, and heartbeat noise displaces real conversations.

Root Cause

Right now the ordering feels like dashboard astrology — "why is this one first?" "because the vibes said so." A clear, live-updating lastMeaningfulActivityAt with a visible reason label gives you messaging-app behavior without heartbeats constantly yeeting sessions to the top.

Code Example

#toolbagcrm  •  user msg  •  12s ago
DM with Tim  •  assistant reply  •  1m ago
heartbeat    •  3m ago             ← only in expanded view, not a bubble trigger
RAW_BUFFERClick to expand / collapse

Summary

The sessions panel should sort sessions by last meaningful activity, not last message timestamp. Right now it's opaque — you can't tell why a session is at the top, and heartbeat noise displaces real conversations.

Desired Behavior

Sessions bubble to the top based on lastMeaningfulActivityAt, which is distinct from raw event timestamps and message-only timestamps.

Proposed Timestamp Model

Three tiers:

FieldDefinition
lastEventAtAny event at all (raw, internal, bookkeeping)
lastMeaningfulActivityAtEvents humans care about (see below)
lastVisibleConversationAtHuman/agent conversational turns only

Sessions panel sorts by lastMeaningfulActivityAt.

What counts as meaningful activity

Bubbles to top:

  • Inbound user message
  • Assistant reply
  • Manual session input
  • Thread/channel activity tied to that session
  • Session spawn / resume / handoff

🟡 Maybe bubble (configurable or context-dependent):

  • Tool calls with meaningful output
  • Sub-agent completion events

Does NOT bubble:

  • Heartbeat acks
  • Internal bookkeeping / token/status updates
  • Background churn

Sub-Agent Rollup

Without this, the top of the sessions list becomes a graveyard of anonymous coding agents and background workers, with the actual conversation buried at slot 7.

Proposed behavior:

  • Child sessions keep their own timestamps
  • Parent session gets a rolled-up lastMeaningfulActivityAt = max(parent, all children)
  • UI hides child sessions by default (optionally nestable/expandable under parent)

UI

Each session row should show a small secondary line explaining why it's at the top:

#toolbagcrm  •  user msg  •  12s ago
DM with Tim  •  assistant reply  •  1m ago
heartbeat    •  3m ago             ← only in expanded view, not a bubble trigger

Why This Matters

Right now the ordering feels like dashboard astrology — "why is this one first?" "because the vibes said so." A clear, live-updating lastMeaningfulActivityAt with a visible reason label gives you messaging-app behavior without heartbeats constantly yeeting sessions to the top.

extent analysis

Fix Plan

To implement the desired behavior, follow these steps:

  • Update the database schema to include lastMeaningfulActivityAt and lastVisibleConversationAt fields for each session.
  • Create a function to calculate lastMeaningfulActivityAt based on the proposed timestamp model:
def calculate_last_meaningful_activity(session):
    meaningful_activities = [
        session.last_user_message_at,
        session.last_assistant_reply_at,
        session.last_manual_input_at,
        session.last_thread_activity_at,
        session.last_spawn_or_resume_at
    ]
    return max(meaningful_activities) if meaningful_activities else None
  • Update the sessions panel to sort by lastMeaningfulActivityAt:
sessions = Session.query.order_by(Session.last_meaningful_activity_at.desc()).all()
  • Implement sub-agent rollup by updating the parent session's lastMeaningfulActivityAt when a child session is updated:
def update_parent_session(parent_session, child_session):
    parent_session.last_meaningful_activity_at = max(
        parent_session.last_meaningful_activity_at,
        child_session.last_meaningful_activity_at
    )
  • Update the UI to display a secondary line explaining why each session is at the top:
<div>
  {{ session.name }} • {{ session.last_meaningful_activity_reason }} • {{ session.last_meaningful_activity_at }}
</div>
  • Add a configuration option to control whether tool calls with meaningful output and sub-agent completion events bubble to the top.

Verification

To verify that the fix worked, check the following:

  • Sessions are sorted correctly by lastMeaningfulActivityAt.
  • The UI displays a secondary line explaining why each session is at the top.
  • Sub-agent rollup is working correctly, with parent sessions updated when child sessions are updated.
  • Configuration options are working as expected.

Extra Tips

  • Consider adding a background job to periodically update lastMeaningfulActivityAt for all sessions to ensure data consistency.
  • Use a caching layer to improve performance when retrieving sessions and calculating lastMeaningfulActivityAt.

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, not just last message [3 comments, 1 participants]