fix: require mediated delivery for subagent announce completions#80223
fix: require mediated delivery for subagent announce completions#80223moeedahmed wants to merge 3 commits into
Conversation
15a9af4 to
0cdaef5
Compare
0cdaef5 to
21738b1
Compare
|
Codex review: needs changes before merge. Summary Reproducibility: yes. source-level: production subagent completions pass Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the mediated-delivery guard, but pair it with explicit message-tool-only guidance or an equivalent runtime mode for Do we have a high-confidence way to reproduce the issue? Yes, source-level: production subagent completions pass Is this the best way to solve the issue? No. Adding the set entry blocks raw fallback, but without message-tool-only guidance or runtime mode it can turn a normal completion final answer into a missing-delivery failure. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 26da4edbe150. |
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
Fresh real-behavior recurrence — 2026-05-15Reproduced the exact failure this PR addresses on installed runtime Observation 1 — gateway log (14:01–14:06 GMT+1): Operator dispatched parallel ACP workers via Worker output was lost. User saw nothing in Telegram. Operator manually Observation 2 — independent ACP-route test (14:08 GMT+1): Operator separately tested the Claude Code ACP route on a different
Same root: announce-side delivery commits on intermediate output rather 24h ACP success/failure ratio on this installation:
Of the 71 succeeded, ~16% had PR labels show |
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
The subagent_announce addition to AGENT_MEDIATED_COMPLETION_TOOLS was unrelated to the routing fix and could cause group/channel completions to fail silently when the subagent does not use the message tool. This should be addressed separately with proper message-tool-only guidance (tracked in openclaw#80223).
Summary
Treat
subagent_announcecompletions like other agent-mediated completion sources so group/channel completions do not fall back to raw child-result delivery when the completion agent fails to deliver through the message tool.Why
Subagent completion events are internal handoff data. In visible group/channel surfaces, the requester/orchestrator should deliver a normal user-facing response. If the completion agent does not use the message tool, the runtime should report the missing mediated delivery instead of raw-sending child output.
Change
subagent_announceto the agent-mediated completion source set.subagent_announcedo not raw-send fallback output when message-tool delivery is missing.Tests
npm test -- --run src/agents/subagent-announce-delivery.test.tsResult: 31/31 passed.
Real behavior proof
Behavior or issue addressed: Subagent completion events could fall back to raw child-result delivery in visible group/channel surfaces if the completion agent did not deliver through the message tool.
Real environment tested: Moeed's live OpenClaw 2026.5.5 installation on macOS with the installed runtime hotfix matching this source change.
Exact steps or command run after the patch: Applied/verified the local installed-runtime hotfix with the OpenClaw reapply bundle, inspected the installed runtime marker, and verified the bundle against the live installed OpenClaw version.
Evidence after fix: Copied live terminal output from the real OpenClaw setup:
Live patch verification command output:
Observed result after fix:
subagent_announceis handled through the mediated-delivery guard in the installed runtime, so group/channel completion paths require message-tool/orchestrator delivery instead of falling back to raw child-result output.What was not tested: I did not send another raw child result into a public Telegram group after the patch; the live verification confirms the installed runtime carries the mediated-delivery guard, and the targeted regression covers the fallback path.
Contributor response to ClawSweeper proof request
Additional live proof from the later subagent delivery validation:
After applying the equivalent installed-runtime fix locally, a native subagent smoke completion returned through the internal
subagent_announcecompletion path for Operator mediation rather than as a raw child-result message in Telegram.Redacted live evidence:
This is the behaviour the PR is intended to preserve:
subagent_announcecompletions are treated as mediated agent completions, so the requester/orchestrator owns the visible user-facing report and raw child output is not used as a fallback visible message.The installed runtime was also inspected after the hotfix and showed:
Targeted regression remains: