fix(message): route WebChat message tool sends to source sink#96850
fix(message): route WebChat message tool sends to source sink#96850harjothkhara wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 25, 2026, 7:21 PM ET / 23:21 UTC. Summary PR surface: Source +9, Tests +31. Total +40 across 2 files. Reproducibility: yes. from source inspection: current main leaves implicit WebChat/internal message tools without Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the targetless internal WebChat send repair, but separate local send routing from run-level message-tool-only final-answer semantics and add coverage plus redacted live WebChat proof before merge. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main leaves implicit WebChat/internal message tools without Is this the best way to solve the issue? No. The targetless send-routing repair is plausible, but the current patch uses the derived tool-local mode as the message-tool-only description/final-answer contract even when the run-level WebChat delivery mode remains automatic. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 95b97e5b0b5e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +9, Tests +31. Total +40 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Setting expectations on the proof gate: the six-field real-behavior-proof block is in the PR body and the What the PR is verified against instead (in the body):
So the fix is verified at the test + source-contract level, just not via a live in-chat capture. Happy for a maintainer to run the live WebChat verification or apply the proof override if that's sufficient. |
|
Canonical fix #97167 has now landed on It preserves automatic WebChat final replies, routes targetless |
What Problem This Solves
Fixes #96840.
Targetless
message.sendcalls created for WebChat source turns were still using automatic source delivery, so the outbound runner required an explicit target even though WebChat should provide the internal source-reply sink for message-tool sends.Why This Change Was Made
The fix keeps ordinary WebChat room-event turns on automatic source delivery, but defaults WebChat-constructed (internal-channel) message tools to
message_tool_onlyunless a caller explicitly supplies another source delivery mode. That keeps the existing gateway routing behavior intact while giving targetless WebChat message-tool sends the internal sink they need.User Impact
WebChat agents can call
message.sendwithout an explicit target when replying to the current source, matching the documented/source-backed behavior. Explicit automatic source delivery remains preserved for callers that request it.Real behavior proof
Behavior addressed: Targetless
message(action="send")from an active WebChat run failed withAction send requires a targetinstead of being projected into the active chat via the internal source-reply sink (#96840, perdocs/web/webchat.md). After this patch, internal-channel (WebChat) message tools defaultsourceReplyDeliveryModetomessage_tool_only, so a targetless send routes through the internal sink.Real environment tested: Local
openclawsource checkout in isolated git worktrees — PR branchoss/96840-webchat-message-tool-sink(6c80752285) versus basemain(c68484acc4) — Node + pnpm,node scripts/run-vitest.mjswith external boundaries mocked.Exact steps or command run after this patch: Ran the focused regression test against base
main(fix absent) and against the PR branch via the repo's vitest runner, then the sibling/contract suite on the branch:Evidence after fix: Red-green plus a source/contract trace:
main(fix absent):Tests 2 failed | 2 passed— "defaults webchat message tools to the internal source-reply sink" fails withAssertionError: expected undefined to be 'message_tool_only'.Test Files 2 passed (2) · Tests 4 passed.Test Files 6 passed (6) · Tests 249 passed (249)(fullmessage-tool+message-action-runner.send-validation+gateway/tool-resolution).applyImplicitSourceReplySendPolicy(src/infra/outbound/message-action-runner.ts:604) setsbestEffort=trueonly whenaction==="send" && sourceReplyDeliveryMode==="message_tool_only"and no explicit foreign target — bypassing theAction send requires a targetthrow (src/infra/outbound/message-action-normalization.ts:76). This patch makes internal-channel message tools default to that mode.Observed result after fix: Targetless WebChat
message.sendresolves withsourceReplyDeliveryMode=message_tool_onlyand is routed to the internal source-reply sink with no target required. Ordinary WebChat room-event turns remain onautomatic, and explicitsourceReplyDeliveryModeoverrides are preserved — both verified by the tests above.What was not tested: A live WebChat send and Control-UI visual capture were out of scope; the repo's gate is focused red-green plus a source/contract trace. The full monorepo vitest suite was not run — coverage was scoped to the affected message-tool module plus the runner send-validation and gateway tool-resolution contracts (249 tests). Non-internal-channel providers are unchanged and exercised by their existing passing tests.
AI assistance disclosure: Codex helped identify the source-sink boundary and implement the patch; the red-green and source/contract proof above were produced with Claude.