Repository navigation
fix(codex): deliver delegated results after the parent yields - #152172
Conversation
Keep the original accepted-spawn receipt authoritative for its operational run. Reuse the canonical receipt normalizer in Codex and Copilot so completion intent survives harness projection and result middleware. QA runtime-pair reproduction on macOS and Linux exposed successful children left pending after the requester yielded. Preserve completion ownership so the parent resumes and delivers their results. This repair does not claim to explain the separately reported chat.history request timeout.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 5:40 PM ET / 21:40 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR preserves delegated-task completion receipts when parents yield, shares their normalization across Codex and Copilot, and updates regression coverage and SDK documentation. Merge readiness⛔ Blocked before merge - 1 item remains This remains a necessary, focused repair; current main still loses completion intent. No actionable correctness findings remain. The prior SDK packaging warning is covered by the existing release-synchronization workflow, rather than requiring another pre-merge repair. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s spawn tool records accepted child tasks, while harness adapters carry their results back to the agent runner. When a parent yields, the runner transfers completion delivery to the existing subagent registry so the parent can resume. flowchart TD
A[Parent delegates task] --> B[Spawn tool records acceptance]
B --> C[Codex or Copilot adapter]
B --> D[Receipts for the admitted run]
C --> D
D --> E[Parent settlement and authority check]
E --> F[Child completion delivery]
F --> G[Parent resumes and replies]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -18, Tests +80, Docs +8. Total +70 across 9 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical receipt normalizer and producer-owned accounting, distributing the updated harnesses with their matching SDK through the established release workflow. Do we have a high-confidence way to reproduce the issue? Yes: the unchanged subagent-handoff scenario and recorded baseline failures identify a concrete path, and fetched-main source confirms the receipt loss. This read-only review did not execute it. Is this the best way to solve the issue? Yes: preserving the producer receipt and reusing the existing normalizer repairs the owning invariant without introducing another delivery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9dd45f672760. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready review of the delegated-completion receipt repair at The spawning tool records the complete receipt before returning. Codex's duplicate normalizer omitted I independently inspected the producer, canonical accounting, both harness consumers, backend projection, requester settlement, and regression coverage. I also inspected The retained evidence was independently read: baseline handoff failed twice on macOS and once on Linux with a successful child and pending delivery; focused regressions failed before repair. All 378 focused tests, the private-QA build, and the full selected changed-file gate passed. Five unchanged runtime-pair handoff runs passed on Node 24.19.0, covering ten OpenClaw/Codex cells, with suite durations 69.94s, 105.86s, 104.09s, 110.44s, and 150.38s. The scenario ran the actual isolated Gateway and native Codex with a managed mock provider and QA channel. The reviewed patch survived the clean rebase unchanged. Fresh independent P0–P2 autoreview found no actionable defects. The runtime proof command was: OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build
pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.5 --alt-model openai/gpt-5.6-luna-alt --runtime-pair openclaw,codex --scenario subagent-handoff --output-dir .artifacts/qa-e2e/subagent-handoff-proofCompatibility disposition: the maintainer accepts the coordinated core SDK, Codex, and Copilot release. The new plugin builds must ship with a core build containing this export; released v2026.9.4 lacks it. Actual release callers enforce synchronization: Independent plugin publication is not certified here: The separate pre-dispatch Exact-head CI 35397266923 is green. |
|
Merged via squash.
|
…penclaw#152172) Keep the original accepted-spawn receipt authoritative for its operational run. Reuse the canonical receipt normalizer in Codex and Copilot so completion intent survives harness projection and result middleware. QA runtime-pair reproduction on macOS and Linux exposed successful children left pending after the requester yielded. Preserve completion ownership so the parent resumes and delivers their results. This repair does not claim to explain the separately reported chat.history request timeout.
Closes #152170.
What Problem This Solves
Fixes completed OpenClaw subagent results remaining pending when a Codex-backed parent yields before the child finishes.
User Impact
A parent can resume and deliver its delegated result after yielding. Completion ownership survives harness result projection and presentation middleware.
Why This Change Was Made
Codex's duplicate spawn-result normalizer dropped
expectsCompletionMessage. Its partial receipt then replaced the complete receipt already recorded by the spawning tool, so core skipped the requester-settlement transfer. Keep the first receipt authoritative for the exact operational run, and use the existing canonical normalizer from the harness SDK in both Codex and Copilot. Document the receipt contract and preserve the existing successful-launch assertions.Production changes are +17/-35 (net -18). The new sibling test file moves the existing accepted-spawn cases out of an oversized suite and extends their contract coverage. No configuration, schema, migration, or deadline change is required.
Evidence
The unchanged runtime-pair handoff scenario failed twice on macOS and once on Linux with a successful child, pending delivery, and no parent reply. The Linux reproduction used Node 24.19.0: https://github.com/openclaw/openclaw/actions/runs/35390690077 . Its command failed as expected; the task-owned Testbox was subsequently stopped.
Focused bridge and requester-settlement regressions failed before the repair. The final candidate passed all 378 focused tests across Codex, Copilot, backend projection, and requester settlement; the private-QA build and full selected changed-file gate passed. The latter ran in a separate physical checkout to honor the declaration-preparation dependency guard. Fresh independent P2 review found no actionable defects.
Five consecutive unchanged runtime-pair handoff runs passed on Node 24.19.0 (both OpenClaw and Codex cells each time), with no retries, relaxed assertions, or changed timeouts:
{"scenario":"subagent-handoff","runtimePair":["openclaw","codex"],"providerMode":"mock-openai","runs":5,"passed":5,"failed":0,"skipped":0,"suiteSeconds":[69.94,105.86,104.09,110.44,150.38]}The proof used the actual isolated Gateway, native Codex runtime, managed mock provider, and QA channel. The branch was then rebased cleanly onto current main;
git range-diffconfirms the reviewed repair is unchanged.This was discovered during the investigation of Release Checks run 35382455441. That run's separate pre-dispatch
chat.historytimeout is associated with the shared-state admission inversion addressed by #152050; this PR does not claim that separate timeout repair. Native Codex-child receipt work in #149490 uses a different ownership path.Compatibility disposition
The maintainer accepts the coordinated SDK, Codex, and Copilot release contract for this repair. These plugin builds must ship with a core build containing the new export. Released v2026.9.4 does not contain it. The normal release path runs
release:check→release:generated:check→scripts/release-preflight.mjs --check; its plugin-version check invokesscripts/sync-plugin-versions.ts --check.scripts/release-fast-pretag-check.shalso runsplugins:sync:checkdirectly. The synchronizer alignsopenclaw.compat.pluginApiwith the chosen core release version; npm runtime packaging derives the OpenClaw peer floor from that metadata, and the installer enforces it.Independent plugin publication is not certified by this PR: the Plugin NPM Release workflow calls
plugin-npm-release-check.ts, which does not invoke the synchronizer itself. A separate publication must update/synchronize the compatibility floor before publishing. Main-push preview cannot publish; the publish job requires workflow dispatch and release approval. This normal main repair does not guess a future release version, add a runtime fallback, or perform any release/publication action. This explicitly resolves the coordinated-release risk in the ClawSweeper review.