Skip to content

Control UI: Subagent sessions not displayed in Sessions view #39645

Description

@finderstrategy-cyber

Bug Description

The Control UI does not display subagent sessions when viewing the Sessions list. Only the main agent session is visible, but subagent conversations are missing from the UI.

Environment

  • OpenClaw Version: 2026.3.7 (42a1394)
  • Host: macOS (Darwin 25.3.0 arm64)
  • Channel: webchat (Control UI)

Current Behavior

When opening the Sessions view in Control UI:

  • Only main agent session (agent:main:main) is displayed
  • Subagent sessions (e.g., agent:pony:subagent:xxx, agent:heartbeat:subagent:xxx) are not visible

Expected Behavior

The Sessions view should display all sessions including:

  • Main agent sessions
  • Subagent sessions (nested under parent or in a separate section)

Evidence

Subagent session files exist and contain valid data:

$ ls -la ~/.openclaw/agents/pony/sessions/
total 312
-rw-------  1 strategyfinder  staff   34265 Mar  8 21:29 0f6beb29-dce4-40eb-81af-27c416ee4248.jsonl
-rw-------  1 strategyfinder  staff    2105 Mar  8 21:17 4f683a6c-8401-40a9-8309-625854c831e4.jsonl
-rw-------  1 strategyfinder  staff  116047 Mar  8 21:29 sessions.json

Subagent list API works correctly:

$ subagents action=list
total: 6
recent (last 30m):
1. 健康检查:请回复"Pony agent 正常运行... (qwen3-coder-next, 1m) done
2. 健康检查:请回复"Heartbeat agent 正常运行... (qwen3-coder-next, 1m) done

Root Cause Analysis

The issue appears to be in the Control UI's session query logic:

  • Subagent session keys follow the format: agent:<name>:subagent:<id>
  • UI likely only queries sessions for the current agent context
  • No recursive query for nested subagent sessions

Impact

  • Users cannot view subagent conversation history in UI
  • Debugging subagent behavior requires CLI access to transcript files
  • Reduced visibility into multi-agent workflows

Suggested Fix

Update the Sessions view to:

  1. Query sessions recursively for all agent types
  2. Display subagent sessions with clear parent-child relationship
  3. Add filtering/grouping options (by agent, by parent session)

Workaround

Users can view subagent sessions via CLI:

# List subagent sessions
cat ~/.openclaw/agents/pony/sessions/sessions.json | jq 'keys'

# View specific session content
cat ~/.openclaw/agents/pony/sessions/<session-id>.jsonl | jq -r '.content'

Priority: Medium - affects debugging and visibility but doesn't break core functionality

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