Repository navigation
fix(agents): restore missing subagent replies after steering or yield - #118117
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 2:55 PM ET / 18:55 UTC. ClawSweeper reviewWhat this changesThe branch binds subagent completion to the original child task and durable requester session so a steered or yielded child can wake its requester after Gateway restart. Merge readinessThis PR is still necessary and should remain open for maintainer merge review. Current Priority: P1 Review scores
Verification
How this fits togetherA requester can spawn subagents and yield its active turn while their work continues. The subagent registry persists child ownership in SQLite, restores it after restart, and wakes the requester when the original child tasks have settled. flowchart LR
Requester[Requester session] --> Spawn[Spawn child task]
Requester --> Yield[Yield active turn]
Spawn --> Registry[Durable subagent registry]
Yield --> Registry
Registry --> Restore[Gateway restart restore]
Restore --> Settle[Settle original child task]
Settle --> Wake[Wake durable requester]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +123. Total +124 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve one canonical durable requester session and original child-task identity through yield, SQLite restoration, and completion settlement; merge after the exact PR head passes its remaining required checks. Do we have a high-confidence way to reproduce the issue? Yes. Current source establishes both mismatched ownership paths, and the branch supplies focused tool-factory and SQLite-restoration regression scenarios for the affected steering and yield flows. Is this the best way to solve the issue? Yes. The branch repairs the two canonical ownership boundaries—yield recording and restart restoration—rather than adding a downstream delivery fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c2559e2d9b4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
51d5daf to
d89b53b
Compare
|
Maintainer exact-head review completed at d89b53b. Root cause: requester yield recorded the controller session instead of the durable run session, and restart restoration reconstructed a steered child with its mutable run ID rather than original taskRunId. Canonical owners now persist the durable session and settle immutable original child tasks; SQLite-backed yielded and ordinary restore paths each wake the correct requester exactly once. Production delta +1 line, no schema/config/protocol changes. Hosted Blacksmith final-source tool-factory/requester-yield/SQLite proof: 61/61 tests. Exact-head CI https://github.com/openclaw/openclaw/actions/runs/30762029700 including check-test-types and ci-gate, Workflow Sanity https://github.com/openclaw/openclaw/actions/runs/30762029667 , and real behavior proof https://github.com/openclaw/openclaw/actions/runs/30762027069 all succeeded. Fresh full-branch Sol/high review clean, confidence 0.96. I personally read the latest ClawSweeper review; its only rank-up requested waiting for exact-head CI, now fully satisfied. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users waiting for a spawned agent could receive no final reply when a child was steered before Gateway restart, or when a sandboxed/controller session differed from the real completion-owner session.
Why This Change Was Made
Requester completion is owned by the durable requester session and the original immutable child task identity. Restart restoration now reconstructs accepted children with their original task identity, and the yield hook marks the actual trimmed completion-owner session before ending the requester turn. Existing controller/policy identity and persisted schema remain unchanged.
User Impact
Completed child-agent work reliably wakes the original requester after steering, restart, and sandboxed session projection. Normal sessions, whitespace/absent overrides, and non-yielded completion keep their existing behavior.
Evidence
settled=false, made no persistence update, and scheduled no requester wake for a restored steered child; a controller/durable-owner split likewise marked zero children and lost the requester wake.pnpm test src/agents/openclaw-tools.registration.test.ts src/agents/subagent-registry.persistence.resume.test.ts src/agents/subagent-registry-requester-yield.test.ts— 61/61 tests across three files passed.gpt-5.6-sol/high autoreview: no actionable P0/P1 findings; confidence 0.93. TruffleHog clean.