-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
CLI sessions --json missing subagent runtime parent metadata (spawnedBy, label, status, sessionFile) #80286
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact: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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact: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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
openclaw sessions --agent <agent> --jsondoes not exposespawnedBy,label,status, orsessionFilefields that are present in the underlying Gateway session store (sessions.json). This blocks consumers that need to reason about subagent runtime parent lineage from the supported CLI surface.Reproduction
In an OpenClaw deployment with at least one agent that has spawned subagents:
Returned keys are limited to a thin subset (e.g.
key,sessionId,updatedAt,ageMs,agentId,agentRuntime,inputTokens,outputTokens,model,modelProvider,contextTokens,kind).spawnedBy,label,status,sessionFile,sessionStartedAt,lastInteractionAtare absent.The store row contains the rich runtime parent metadata. The same is true through
--store <path> --jsonand--store --verbose --json— the projection is consistent across all documentedopenclaw sessionsflag combinations.We confirmed this empirically against an active deployment: 44 subagent rows total, 44 with
spawnedBypresent insessions.json, 0 withspawnedByexposed via CLI JSON.Why this matters
Read-only consumers (lineage detectors, governance audits, fleet observability) that follow substrate-discipline (CLI as authoritative interface, no direct store reads) currently cannot:
runtimeLineageCoveragePctaccuratelyWe are working around this by emitting
sourceShapeStatus="blocked_no_rich_source"and honest zero-coverage counters until a supported surface exposes the fields.Requested fields on
openclaw sessions ... --jsonMake these additive (optional) on the existing JSON projection:
spawnedBystring?labelstring?statusstring?live,done,aborted, ...)sessionFilestring?sessionStartedAtnumber?lastInteractionAtnumber?subagentRolestring?leaf/branch/rootsubagentControlScopestring?none/limited/fullspawnedWorkspaceDirstring?Backward compatibility: existing fields unchanged, all new fields optional, omitted when absent in store.
Possible shapes
Option A — extend default projection. Map the Gateway-side fields directly onto the CLI JSON output. Single source, minimal churn for consumers, slight output-size increase.
Option B — opt-in flag. New
--include-parent-metadata(or similar) that gates the rich projection. Avoids any output-size impact for current consumers.Either works for our use case.
Acceptance
openclaw sessions --agent <agent> --jsonreturnsspawnedByfor every subagent row whose store entry has it.openclaw sessions --store <path> --jsonreturns the same fields when reading a store path directly.Docs reference
docs/cli/sessions.mdnotes that the CLI returns minimal row fields by default; the request here is to make subagent runtime parent metadata reachable via the supported CLI surface so consumers don't have to choose between losing the data and reading the persisted store directly.