Skip to content

Dashboard dropdown shows all historical subagent sessions (completed/killed) with no cleanup option #37238

Description

@mizoz

Bug Description

The OpenClaw Control UI dashboard dropdown displays all session records including completed, killed, and timed-out subagent sessions. These persist indefinitely even after the subagents are no longer running.

Current Behavior

  • sessions_list API returns all sessions from the transcript store
  • Dashboard dropdown shows 9+ sessions (1 main + 8 historical subagents)
  • Completed/killed subagents remain visible:
    • smoke-test (completed)
    • dns-config (timeout)
    • vercel-deploy (timeout)
    • email-system (completed)
    • design-system (completed)
    • stripe-checkout (completed)
    • rebuild-pages (completed)
    • onboarding-flow (completed)

Expected Behavior

Dashboard dropdown should show:

  1. Active sessions only (running subagents + main session), OR
  2. Recent sessions (e.g., last 24-48 hours) with pagination, OR
  3. Provide a cleanup/archive UI to remove historical session records

Impact

  • Visual clutter in the dashboard
  • Confusing UX (appears like 10 agents are running when only 1 is active)
  • No way to clean up via UI or CLI
  • Session transcript files accumulate at ~/.openclaw/agents/main/sessions/*.jsonl

Steps to Reproduce

  1. Spawn multiple subagents via sessions_spawn
  2. Let them complete or kill them via subagents kill
  3. Open Control UI dashboard
  4. Check session dropdown — all historical sessions still appear

Environment

  • OpenClaw version: latest (dev channel)
  • OS: Pop!_OS 24.04 LTS (Linux 6.18.7)
  • Node: v25.6.1
  • Channel: Telegram
  • Model: bailian/qwen3.5-plus

Proposed Solutions

Option A: Filter by Status (Recommended)

  • Dashboard dropdown shows only active sessions
  • Add "Show History" toggle to view completed sessions
  • API: sessions_list?activeOnly=true

Option B: Time-Based Retention

  • Default: show sessions from last 24 hours
  • Pagination for older sessions
  • Config: dashboard.sessionRetentionHours

Option C: Manual Cleanup

  • Add openclaw sessions cleanup CLI command
  • Add "Clear History" button in dashboard
  • Archive transcripts to ~/.openclaw/agents/main/sessions/archive/

Additional Context

Session files are stored at:

~/.openclaw/agents/main/sessions/<sessionId>.jsonl

Current workaround: manually delete .jsonl files (not recommended without proper cleanup).


Priority: Medium (UX issue, not functional blocker)
Labels: bug, ui, sessions

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions