Repository navigation
fix: return a busy child's steering receipt at once - #202139
Conversation
sessions_send steering into a busy run now returns accepted/steered as soon as the receiving run accepts the message, instead of waiting up to 30 s for the transcript commit and reporting an error. The receiving run owns accepted input until it commits or ends. The durable fallback and commit-wait path for sessions_send are removed; the tool deadline result uses the schema's error status. The steerTargetRunId stamp is written on the committed row, which also covers plugin steering. Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: ba2fc1ea-b29e-8da6-863b-ff6d2b963513
|
🦞👀 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: needs changes before merge. What this changesThis PR acknowledges accepted child steering immediately and records steering provenance when the transcript commits. Example: A parent sends MARKER while its child runs a 75-second command.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR addresses a concrete false failure when steering a busy child, but a newly added identity comparison blocks the baseline-ratchet check. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe sessions_send tool authorizes inter-session communication, submits guidance through the session controller, and returns a receipt while the receiving runtime owns consumption and transcript persistence. flowchart TD
A[Parent agent] --> B[sessions_send]
B --> C[Communication admission]
C --> D[Session controller]
D --> E[Child input queue]
D --> A
E --> F[Transcript recorder]
F --> G[Child model turn]
Technical reviewBest possible solution: Keep the admission-only receipt and existing persistence owners, removing the redundant caller-side stamp comparison before merge. Do we have a high-confidence way to reproduce the issue? Current main waits for steering transcript commitment under a 30-second admission ceiling, matching the reported long-tool-call failure; the PR records a real Gateway comparison, and no target code was executed during this review. Is this the best way to solve the issue? Returning the existing runtime admission receipt directly addresses the false failure, and the stamp changes preserve provenance without another delivery owner; the duplicate identity check should remain solely in the existing transcript update operation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b4d5d08b689. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -18, Tests -13, Docs -4. Total -35 across 16 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 19, 2026, 7:35 PM ET / November 20, 2026, 00:35 UTC. |
Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: a9e3c4cc-1a2f-8603-b4cf-5cbb3d27dd57
|
Maintainer override: Ayaan approved landing this PR over one unrelated red check.
|
|
Landed as c3d6582, from head 89851f8.
|
## What Problem This Solves When a parent agent sends a message to its own child while the child is busy in a long tool call, `sessions_send` waits about 30 s and then reports an error. The message does reach the child, but the parent thinks the send failed and often retries or gives up. ## User Impact User impact: a parent's message to a busy child now returns at once as `accepted` / `steered`, and the child still sees the message at its next steering boundary. ## Why This Change Was Made - Steering returns at acceptance. Once the receiving run accepts a steered message, it owns that message until it commits it or the run ends. `sessions_send` no longer waits for the transcript commit. The durable-fallback and commit-wait path for `sessions_send` steering is removed. - Admission-only contract: after acceptance, the receiving run owns the steered input until it commits or the run ends; a refused commit is never seen by the model, and custody is released exactly once when the run ends. - The tool deadline result now uses the schema's `error` status instead of a `timeout` shape the schema did not allow. Models see this change. - The `steerTargetRunId` stamp is written on the committed transcript row as part of the admission write, and confirmation no longer waits for runtime persistence. This also stamps plugin steering, which previously had no stamp. - Commit-wait (`waitForTranscriptCommit: true`) and its `timeout` status remain for the other callers (announce, `chat.send`, steer adoption). Known window: if the receiving run is cancelled or fails, or the Gateway restarts, between acceptance and the next steering boundary, the steered message is withdrawn although the sender holds `accepted`. Plugin steering on main already has this window. On main's restart model, a restart stops the child and wakes the parent, so the parent learns the child was interrupted and can resend. Making accepted steers survive a restart needs a replay-authority decision and is not part of this PR. Split from openclaw#202111. The restart half of that PR is parked as reference, because main's own restart model now owns that class. ## Evidence Real Gateway journey on a built Gateway (isolated state, real model), current main vs this branch. The parent spawns a child doing a 75 s exec, sends it a MARKER with `sessions_send`, then waits: | | main (`e9b9f42d`) | this branch | |---|---|---| | `sessions_send` call → result | 30,066 ms, `error` | 74 ms, `accepted` / `steered` | | Steered MARKER row in the child, and the MARKER in the child's final reply | 1 row, stamped; in the final reply | 1 row, stamped; in the final reply | Tests: - Steering receipt at acceptance (red on main: the steering-provenance test hangs 120 s, and the admission test returns `status: "timeout"`). - The commit stamp is written for uncommitted messages. - Steering custody is released exactly once when the receiving run ends, including the source-revoked case (the refused commit never reaches the transcript). - The plugin steering contract now expects the stamp. - Suites: sessions_send 11/13/132, user-turn transcript 89, steering custody 5, all green. tsgo and lint are clean. Production code: +32 / −48 (net −16). The stamp now joins the admission write without an extra run-id comparison (session-identity ratchet). One drive-by lint fix: `agent-step.ts` drops a default `callGateway` type argument that the changed-lint lane flagged. **Merge danger:** - Two-way door: no schema, config or stored-state change. - Blast radius: agents that steer a busy session with `sessions_send`, and plugin steering stamps. Co-authored-by: Ayaan Zaidi <[email protected]>
…201373) Baseline adaptation: Bound admission and inline reply observation in the shipped sessions_send owner without importing the upstream executor split, self-held replay, or steering changes. Handoff retains accepted replies with the existing continuation or registry owner. Preserve receipts on caller revocation and use the existing error schema for uncertain admission timeout, matching the targeted fixes in #203901 and #202139. (cherry picked from commit da8fd16) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit c6c889760104d608842b9e97e308aad201f1ca30)
Backport the steering contract from upstream c3d6582 (openclaw#202139). A busy recipient owns admitted guidance until transcript commit or run termination. Preserve the fork’s existing requester checks and selection of separate turns.
What Problem This Solves
When a parent agent sends a message to its own child while the child is busy in a long tool call,
sessions_sendwaits about 30 s and then reports an error. The message does reach the child, but the parent thinks the send failed and often retries or gives up.User Impact
User impact: a parent's message to a busy child now returns at once as
accepted/steered, and the child still sees the message at its next steering boundary.Why This Change Was Made
sessions_sendno longer waits for the transcript commit. The durable-fallback and commit-wait path forsessions_sendsteering is removed.errorstatus instead of atimeoutshape the schema did not allow. Models see this change.steerTargetRunIdstamp is written on the committed transcript row as part of the admission write, and confirmation no longer waits for runtime persistence. This also stamps plugin steering, which previously had no stamp.waitForTranscriptCommit: true) and itstimeoutstatus remain for the other callers (announce,chat.send, steer adoption).Known window: if the receiving run is cancelled or fails, or the Gateway restarts, between acceptance and the next steering boundary, the steered message is withdrawn although the sender holds
accepted. Plugin steering on main already has this window. On main's restart model, a restart stops the child and wakes the parent, so the parent learns the child was interrupted and can resend. Making accepted steers survive a restart needs a replay-authority decision and is not part of this PR.Split from #202111. The restart half of that PR is parked as reference, because main's own restart model now owns that class.
Evidence
Real Gateway journey on a built Gateway (isolated state, real model), current main vs this branch. The parent spawns a child doing a 75 s exec, sends it a MARKER with
sessions_send, then waits:416b357c)sessions_sendcall → resulterroraccepted/steeredTests:
status: "timeout").Production code: +29 / −47 (net −18).
Merge danger:
sessions_send, and plugin steering stamps.