Repository navigation
feat(agents): allow bounded recursive session spawning by default - #138059
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 5, 2026, 2:39 AM ET / 06:39 UTC. ClawSweeper reviewWhat this changesEnables child sessions to delegate through depth five by default, recalculates existing sessions’ capabilities from current policy, and updates documentation and isolated test routing. Merge readiness⛔ Blocked before merge - 2 items remain This remains useful, maintainer-sponsored work: current main and the latest release retain the depth-one default. No blocking introduced defect was found, and the supplied authority proof supports the changed boundary. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s session-spawning tools turn an agent’s delegation request into a child session and scheduled run. Shared admission and capability policies control nesting, permitted targets, inherited restrictions, and child ownership. flowchart TD
A[Agent delegation request] --> B[Current depth and tool policy]
B --> C[Depth and target admission]
C --> D[Live authority validation]
D --> E[Persist child session]
E --> F[Gateway run dispatch]
F --> G[Child ownership and completion]
C --> H[Visible rejection]
D --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +625, Docs -2, Other +9. Total +638 across 31 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared current-policy depth boundary, tested explicit-cap compatibility, and documented upgrade tradeoff without introducing another spawn path or configuration option. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: depth-one leaf behavior is the established current-main and release default that this feature intentionally changes. Is this the best way to solve the issue? Yes, for the stated direction: the patch updates the existing policy owner and removes stale stored-role precedence. Keeping the existing opt-in alone would not provide the requested default experience. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bfbf880320bf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Addressed on
Exact-head local verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The exact head now includes the requested allowed-path proof through the production Gateway instance facade and in-process dispatcher. It asserts signed |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper assist: This needs a full correctness re-review of Evidence:
Suggested next action: Put the completed exact-head Linux Testbox result, artifact, and race-fix evidence in the main PR body, then request Source: #138059 (comment) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
# Conflicts: # src/agents/subagents/spawn/subagent-spawn.authority.test.ts
|
@clawsweeper re-review Exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…enclaw#138059) * Agents: allow recursive session spawning by default * test: preserve sandbox delegation confinement * test: accept serialized authority rejection * test(agents): prove recursive production dispatch * test(agents): exercise recursive spawn admission * test(agents): isolate recursive spawn authority suites * test(agents): avoid duplicate recursive spawn dispatch mocks * test(agents): serialize isolated runtime mocks * test(agents): isolate recursive spawn boundary proof * test(agents): bound recursive spawn proof stages * test(agents): diagnose spawn boundary admission stalls * test(agents): use deterministic spawn fixture config * test(agents): trace spawn proof setup stages * test(agents): defer gateway graph in spawn proof * test(agents): defer production proof runtime imports * test: stabilize recursive spawn production proof * test: stabilize recursive spawn production proof * test(agents): track gateway execution in spawn proof
Summary
5agents.defaults.subagents.maxSpawnDepthconfigurable from1through5, with sessions at the boundary retaining leaf behaviorWhy
The old default made every direct child a leaf, preventing visible and hidden child sessions from delegating independent work. A finite default of
5enables practical orchestration without allowing a serial self-replenishing chain to grow without a depth bound.Authority and compatibility
5maxSpawnDepth: 1or choose any lower boundary from1through5Verification
pnpm check:changedWorked on by