Repository navigation
fix(subagents): preserve announce drop vs none delivery reasons - #122855
Conversation
Keep live-queue refusals as steer_dropped through dispatch mapping and registry persistence so they stay distinguishable from no viable requester (sink_unavailable). Do not mark dropped as terminal, so completion fallback still returns the primary direct result.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:35 AM ET / 08:35 UTC. ClawSweeper reviewWhat this changesThe PR records a refused active-requester steer as Merge readinessKeep open for maintainer review: current main still collapses dropped and unavailable steer outcomes, while this PR carries the distinction through dispatch and durable cleanup. No discrete patch defect was found, but the branch is behind recent delivery-state work and needs exact-merge validation. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherSubagent completion announcements attempt direct delivery or steering into an active requester, then persist the delivery outcome in the subagent registry. Operators and retry cleanup consume that durable state to distinguish delivery failures. flowchart LR
A[Subagent completes] --> B[Announcement dispatch]
B --> C{Direct or steer result}
C --> D[Delivery phases]
D --> E[Registry cleanup]
E --> F[Durable delivery diagnostics]
F --> G[Operator and retry handling]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +250. Total +266 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land a rebased or merge-result-verified version that preserves both the new dropped diagnostic and current main’s requester-final delivery safeguards. Do we have a high-confidence way to reproduce the issue? Yes: source shows that current main converts both active-session refusal and unavailable-session outcomes into the same delivery shape, and the PR supplies a production-owner trace for the dropped case. Is this the best way to solve the issue? Yes, conditionally: assigning the fact at dispatch and persisting it at the registry owner avoids downstream inference while retaining the direct failure; validate that shape on the current-main merge result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0497cd91bf71. LabelsLabel 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 (5 earlier review cycles)
|
Carry the nonterminal dropped-steer reason on the retained failed direct completion result so registry cleanup can persist lastDropReason.
|
Addressed the completion fallback persistence finding. Dropped steer is still non-terminal; the retained failed direct result now carries @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Completion fallback no longer overwrites the direct failure classification with steer_dropped. Cleanup still persists steer_dropped from the fallback phase so queue refusal stays distinct from sink_unavailable.
…lback Use the no-output Discord completion path so deliverSubagentAnnouncement keeps the direct classification while the fallback phase records steer_dropped.
|
Preserved both facts on completion fallback. Top-level reason stays the direct failure ( Composed delivery plus cleanup regressions fail on @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Added a wall-clock production-owner trace on head @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: felirami <[email protected]>
|
@clawsweeper re-review The maintainer repair is now published at verified head The canonical delivery recorder now owns both A clean three-way integration with current Fresh exact-head CI and Workflow Sanity are pending; both must pass before landing. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…claw#122855) * fix(subagents): preserve announce drop vs none delivery reasons Keep live-queue refusals as steer_dropped through dispatch mapping and registry persistence so they stay distinguishable from no viable requester (sink_unavailable). Do not mark dropped as terminal, so completion fallback still returns the primary direct result. * fix(subagents): persist steer_dropped after completion fallback drop Carry the nonterminal dropped-steer reason on the retained failed direct completion result so registry cleanup can persist lastDropReason. * fix(subagents): keep direct announce reason when steer fallback drops Completion fallback no longer overwrites the direct failure classification with steer_dropped. Cleanup still persists steer_dropped from the fallback phase so queue refusal stays distinct from sink_unavailable. * test(subagents): keep visible_reply_missing through dropped steer fallback Use the no-output Discord completion path so deliverSubagentAnnouncement keeps the direct classification while the fallback phase records steer_dropped. * fix(agents): persist subagent drop diagnostics atomically Co-authored-by: felirami <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: felirami <[email protected]>
Closes #122615
What Problem This Solves
Fixes an issue where operators monitoring subagent completion delivery could tell that an announce failed, but could not tell a live requester queue refusal (
dropped) from no viable requester session (none). Both collapsed topath: "none"and persisted aslastDropReason: "sink_unavailable". A failed completion direct delivery followed by a dropped steer fallback also kept only one reason, so either the direct classification or the queue refusal was lost.Why This Change Was Made
Dropped is not marked terminal, so completion still returns the failed direct result instead of replacing it with the steer miss. Dual-reason design: top-level
reasonstays the direct failure (visible_reply_missing/message_tool_delivery_missing); the fallback phase recordssteer_dropped; cleanup persistslastDropReason: "steer_dropped"from that phase without clobbering the direct code inlastError.This does not add a direct-delivery fallback for a live requester that refused steering.
User Impact
Managers and local monitors can distinguish a refused announce into an active requester from a missing requester session, including the completion path where direct delivery fails and steer fallback is dropped. Both the direct failure classification and the queue refusal remain visible.
Evidence
Head:
05565da36288836ddc822e8eb377d6a9e3c198ffWall-clock Node process (not Vitest). Isolated
HOME/OPENCLAW_STATE_DIR. Drove productionrunSubagentAnnounceFlow→deliverSubagentAnnouncement→runSubagentAnnounceDispatch→startSubagentAnnounceCleanupFlow. RealqueueEmbeddedAgentMessageWithOutcomeAsyncagainst a registered non-streaming embedded requester run (not_streaming→ dropped). Recording fake only at the gateway RPC client (empty announce-agent payloads / emptychat.history).After-fix owner/transport trace (redacted):
{ "topLevelReason": "visible_reply_missing", "phases": [ { "phase": "direct-primary", "delivered": false, "path": "direct", "reason": "visible_reply_missing", "error": "completion agent did not produce a visible reply" }, { "phase": "steer-fallback", "delivered": false, "path": "none", "reason": "steer_dropped" } ], "persistedAtOnDeliveryResult": { "lastDropReason": "steer_dropped", "lastError": "completion agent did not produce a visible reply; visible_reply_missing; direct-primary: completion agent did not produce a visible reply" }, "lastDropReason": "steer_dropped", "queue_client_result": { "queued": false, "reason": "not_streaming", "gatewayHealth": "live" }, "gateway_client": { "method": "agent", "expectFinal": true } }lastDropReasonstayedsteer_droppedafter cleanup. Later retry bookkeeping rewrotelastErrortoannounce deferred or direct delivery failed; that rewrite is existing pending-retry text, not a loss ofsteer_dropped.Not live-run: no live Telegram/Slack/Discord network, no isolated gateway process, no live model provider, no packaged/Docker/Crabbox.
By: @felirami (acct 2014-02-21) | OpenClaw: 13 PRs, 0 issues, 1 commits/12mo | GitHub: 612 commits, 140 PRs, 11 issues, 1 reviews