-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature/Bug]: Isolate subagent completion from parent context; return status + child session link only by default #96975
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper: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.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: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper: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.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: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Type
Fields
Priority
None yet
Problem
Subagent completion currently injects too much child-session content back into the parent/main agent input path. For heavy subagent workloads, this can include long final reports, tool output fragments, or large completion payloads. That makes the parent session inherit the subagent's token pressure and can trigger:
This defeats one of the main reasons to use subagents: isolating large work from the main conversation.
Desired behavior
Subagent execution, transcript, tool outputs, and final verbose content should stay isolated from the parent/main agent by default.
When a subagent finishes, the parent should receive only a small completion envelope, for example:
{ "type": "subagent_completed", "status": "completed|failed|blocked", "childSessionKey": "agent:main:subagent:...", "childSessionId": "...", "runId": "...", "taskName": "...", "sessionLink": "openclaw://sessions/... or UI URL", "summary": "optional short bounded summary, e.g. <= 500-1000 chars" }The parent/main agent can then choose whether to inspect the child session with an explicit tool call (
sessions_history,subagents, or a future dedicated child-result reader). Large child outputs should not be automatically appended to, injected into, or replayed inside the parent prompt.Proposed default policy
No raw child transcript injection into parent input.
Completion event is metadata-only by default.
Large result transfer must be explicit.
Delivery to user channel should also be bounded.
Configurable compatibility mode if needed.
subagents.completion.includeResultPayload=true, but the safe default should be isolation.Why this matters
Large subagent outputs can be tens of thousands of tokens. If those are injected into the parent, the main session pays the cost and risk:
A subagent should behave more like an isolated worker with a result handle, not like a giant hidden paste into the supervisor prompt.
Related issues / prior art
This request is related to, but more specific than:
Acceptance criteria