-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Feature: First-class session/task chain tracking (parent/root/trace/depth) #11040
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper-recovery-stuckclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper-recovery-stuckclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Priority
None yet
Summary
Add first-class session/task chain tracking so OpenClaw can reconstruct subagent execution DAGs without external loggers.
Problem
Today we can partially infer spawn relationships via
spawnedBy,sessions.list(spawnedBy=...), and subagent registry, but we cannot reliably reconstruct an end-to-end chain in one place:sessions_listresultsThis makes analysis/debugging hard (e.g., "which parent spawned this subagent", "did any subagent spawn further", "show full chain for a run").
Proposal (Phase 1: minimal, backward-compatible)
Data model (SessionEntry)
parentSessionKey?: stringrootSessionKey?: stringtraceId?: stringspawnDepth?: numberSpawn write path
When
sessions_spawncreates a child session:parentSessionKey = requester session keyrootSessionKey = parent.rootSessionKey ?? parentSessionKeytraceId = parent.traceId ?? uuidspawnDepth = (parent.spawnDepth ?? 0) + 1Gateway/tool read path
Expose chain metadata in session listing rows so tooling/UI can consume it immediately:
spawnedBy,parentSessionKey,rootSessionKey,traceId,spawnDepthinsessions.listoutput (optional fields)Why this helps
Non-goals in this issue
Follow-up (Phase 2)
sessions.chain)