openclaw - 💡(How to fix) Fix Allow depth-1 subagents to spawn skill-scoped sub-agents (remove sessions_spawn restriction at depth 1 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63365Fetched 2026-04-09 07:54:44
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×1labeled ×1

Enable sessions_spawn within subagent sessions (depth 1) so orchestrator agents can themselves delegate to skill-scoped sub-agents — supporting multi-level agent orchestration patterns.

Root Cause

Enable sessions_spawn within subagent sessions (depth 1) so orchestrator agents can themselves delegate to skill-scoped sub-agents — supporting multi-level agent orchestration patterns.

Fix Action

Fix / Workaround

Currently, sessions_spawn is only available in the main agent session (depth 0). When a parent agent dispatches a specialist agent as a subagent (depth 1), that specialist cannot itself spawn further skill-scoped sub-agents — the tool is simply unavailable.

Main agent dispatches an orchestrator agent- That orchestrator is designed to fan out work across multiple skill-scoped executors in parallel Each executor loads a specific skill and returns a scoped result The orchestrator consolidates and returns one clean report to the main agent Today, depth-1 agents must collapse all their sub-tasks into a single session, defeating the purpose of skill-scoped isolation. The quality and context hygiene benefits of the pattern (isolated context per skill, parallel execution, clean consolidation) are lost.

Context quality: Each executor runs with a clean, minimal context window scoped to one skill domain. No context bleed between domains — a secrets audit and a GDPR review do not share the same token budget or conversation history. Parallel execution: Independent skill domains can run simultaneously instead of sequentially in one bloated session. A 6-domain audit that currently takes one long sequential session becomes 6 parallel sessions converging at consolidation. Context rot mitigation: Long single-session audits accumulate noise — earlier findings pollute attention when reviewing later code. Isolated executor sessions start fresh per domain, eliminating this drift. Specialization fidelity: An executor briefed with one skill and one scope boundary produces higher-quality output than a generalist session context-switching across 10+ skill domains in sequence. Scalability: Orchestrators with many skills currently must either ignore skills or overload a single session. With depth-2 spawning, the number of skills an orchestrator can effectively apply scales with parallelism rather than context size.

RAW_BUFFERClick to expand / collapse

Summary

Enable sessions_spawn within subagent sessions (depth 1) so orchestrator agents can themselves delegate to skill-scoped sub-agents — supporting multi-level agent orchestration patterns.

Problem to solve

Currently, sessions_spawn is only available in the main agent session (depth 0). When a parent agent dispatches a specialist agent as a subagent (depth 1), that specialist cannot itself spawn further skill-scoped sub-agents — the tool is simply unavailable.

This breaks multi-level orchestration patterns where:

Main agent dispatches an orchestrator agent- That orchestrator is designed to fan out work across multiple skill-scoped executors in parallel Each executor loads a specific skill and returns a scoped result The orchestrator consolidates and returns one clean report to the main agent Today, depth-1 agents must collapse all their sub-tasks into a single session, defeating the purpose of skill-scoped isolation. The quality and context hygiene benefits of the pattern (isolated context per skill, parallel execution, clean consolidation) are lost.

Proposed behaviour: Allow sessions_spawn at depth 1, with depth-2 executors enforced as terminal (no further spawning). Depth limit: main → orchestrator → executor. Three levels maximum, hard-capped.

Proposed solution

Lift the sessions_spawn restriction at depth 1 with a hard depth cap of 2 (main → orchestrator → executor). Executors at depth 2 are terminal — sessions_spawn is unavailable to them, preventing unbounded recursion. The orchestrator at depth 1 receives the full tool set of the main session, including sessions_spawn, but executors it spawns do not. This requires no changes to the brief format or existing orchestration contracts — only the runtime availability of sessions_spawn needs to change per depth level.

Alternatives considered

No response

Impact

Context quality: Each executor runs with a clean, minimal context window scoped to one skill domain. No context bleed between domains — a secrets audit and a GDPR review do not share the same token budget or conversation history. Parallel execution: Independent skill domains can run simultaneously instead of sequentially in one bloated session. A 6-domain audit that currently takes one long sequential session becomes 6 parallel sessions converging at consolidation. Context rot mitigation: Long single-session audits accumulate noise — earlier findings pollute attention when reviewing later code. Isolated executor sessions start fresh per domain, eliminating this drift. Specialization fidelity: An executor briefed with one skill and one scope boundary produces higher-quality output than a generalist session context-switching across 10+ skill domains in sequence. Scalability: Orchestrators with many skills currently must either ignore skills or overload a single session. With depth-2 spawning, the number of skills an orchestrator can effectively apply scales with parallelism rather than context size.

Evidence/examples

An orchestrator agent with 11 security-related skills (OWASP, SAST, secrets management, GDPR, STRIDE, threat modelling, etc.) was dispatched as a depth-1 subagent. It attempted to fan out work across 4 parallel skill-scoped executors. sessions_spawn returned unavailable. The entire audit ran sequentially in one session — all 11 skills loaded, 19k output tokens, 6 minutes runtime. Parallel execution of 4 scoped sessions would have reduced runtime to ~2 minutes with cleaner per-domain output. The same limitation applies to performance auditors (Core Web Vitals + backend profiling + image optimization as separate executors), code reviewers (security pass + quality pass + spec compliance as separate executors), and any agent with 4+ skills whose work decomposes naturally into parallel scopes.

Additional information

No response

extent analysis

TL;DR

Enable sessions_spawn at depth 1 with a hard depth cap of 2 to support multi-level agent orchestration patterns.

Guidance

  • Lift the sessions_spawn restriction at depth 1 to allow orchestrator agents to spawn skill-scoped sub-agents in parallel.
  • Enforce a hard depth cap of 2, making executors at depth 2 terminal and preventing unbounded recursion.
  • Verify the change by testing an orchestrator agent with multiple skills and measuring the reduction in runtime and improvement in output quality.
  • Consider the impact on context quality, parallel execution, context rot mitigation, specialization fidelity, and scalability when evaluating the effectiveness of this change.

Example

No code snippet is provided as the issue does not include specific code examples.

Notes

The proposed solution requires no changes to the brief format or existing orchestration contracts, only the runtime availability of sessions_spawn needs to change per depth level.

Recommendation

Apply the workaround by lifting the sessions_spawn restriction at depth 1 with a hard depth cap of 2, as it allows for multi-level agent orchestration patterns and improves the quality and efficiency of the agent's output.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Allow depth-1 subagents to spawn skill-scoped sub-agents (remove sessions_spawn restriction at depth 1 [1 comments, 2 participants]