Repository navigation
fix(message): agent reports a channel reply as sent when it only reached the transcript - #164860
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed October 6, 2026, 11:34 PM ET / October 7, 2026, 03:34 UTC (Revision 6). ClawSweeper reviewWhat this changesThe message tool uses inter-session provenance to report transcript-only replies accurately while preserving WebChat user receipts and explicitly addressed sends. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still overstates transcript-only delivery. The earlier WebChat concerns are resolved, the recorded Gateway proof covers the corrected behavior, and no blocking finding remains. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s message tool sends agent-authored replies through channel transports or records them in the current session transcript. Its receipt tells the model what that particular call accomplished. flowchart TD
A[Agent turn and input origin] --> B[Message tool]
B --> C{Current reply destination}
C --> D[External channel transport]
C --> E[Session transcript]
E --> F{Inter-session input}
F --> G[Transcript-only receipt]
F --> H[Visible WebChat receipt]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +95. Total +108 across 7 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one delivery owner and make its model-facing receipt distinguish a transcript record from an external send. Do we have a high-confidence way to reproduce the issue? Yes: a route-less inter-session turn calling targetless message reaches the transcript sink but receives main’s visible-send receipt. Current source and recorded before/after Gateway observations establish this path; this read-only review did not execute it. Is this the best way to solve the issue? Yes: changing the receipt at its existing owner and carrying established input provenance is a narrow repair that preserves delivery ownership and the WebChat compatibility controls. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d26ebd9fbb8. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Thanks @jayzhou2309 for addressing the route-less delivery overclaim reported in #164732. The receipt currently claims a visible delivery even when this path only records a transcript reply. I did not capture a real-Gateway reproduction during this pass, so this finding is source-backed rather than end-to-end proof. There is an important control case to preserve: The distinction is lost before the runner: Suggested next step: preserve the original source-reply delivery mode (or explicit origin provenance) through to the receipt, so only route-less turns receive the transcript-only wording. Keep structured details unchanged and add a regression proving Control UI/webchat targetless receipt bytes remain identical to main, alongside the route-less regression and a targeted external-send control. I am leaving this PR open without pushing changes; the missing piece is the narrow origin plumbing and its real-Gateway before/after proof. |
…ing to message-tool-only runs Co-Authored-By: Claude Opus 5.5 <[email protected]>
Not covered:
🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309. |
|
Thanks @jayzhou2309 for the quick rework. I verified that default/automatic WebChat now keeps main's receipt byte-for-byte, and that the route-less inter-session case gets the corrected wording without an external send. There is still one WebChat case to preserve: I ran freshly built, isolated Gateways against main
This is a user-facing WebChat turn, not an inter-session result turn. Its targetless message is what the user sees in the Control UI. Delivery mode alone therefore does not distinguish it from the route-less case; changing its receipt also fails the intended WebChat byte-preservation control. Could the wording be keyed to the turn being a route-less inter-session result turn, using the run's existing inter-session/source-session provenance, rather than Other observed controls:
Leaving this open for the remaining WebChat preservation case; no branch changes were pushed. |
A WebChat user turn with messages.visibleReplies=message_tool is message-tool-only too, so the original delivery mode could not tell it from a route-less inter-session result turn. The embedded attempt now passes its input provenance to the message tool, and only inter_session turns get the transcript wording.
|
The transcript wording now depends on the run's input provenance instead of the delivery mode. The embedded attempt passes
I removed the Not verified:
🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 3350e4f. Thanks @jayzhou2309! Verified on a built Gateway with a real one-way sessions_send flow: main told the model the reply was sent to the source conversation; now the tool result says it was recorded in the transcript only, with zero external sends, and a routed send is unchanged. |
…hed the transcript (openclaw#164860) When a target-less message send in a route-less inter-session turn is recorded only in the session transcript, the tool result now says so and that it did not reach an external channel, so the agent no longer reports delivery to a channel user who never saw it. Routed sends and Control UI visibility are unchanged. Closes openclaw#164732. Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…4098) ## Problem In a Control UI chat, when a child finished and the parent sent its update with the `message` tool, the user saw two bubbles: the update, then a second, third-person one ("I sent the user the corrected dates... Still waiting on: ..."). Cause: the requester-settle wake is an inter-session turn. Since #164860, every inter-session internal-sink send was treated as transcript-only. The tool told the model "Recorded reply in the current chat history ... did not deliver it to an external channel", and neither the embedded delivery fact nor the Claude CLI tracker (#170534) counted the send as the turn's answer. A reply was still owed, so the model wrote an epilogue to the inter-session sender, and Control UI showed it as a normal assistant row. ## Solution - One fact, computed where the message tool is built: an internal-sink send is transcript-only only when the turn is inter-session **and** the session has an external delivery record (`sessionDeliveryChannel(entry)`, the same record `resolveAnnounceOrigin` treats as the external binding). It feeds the receipt and the embedded delivery fact (`messageDelivery.sourceReplyDelivered`). - The Claude CLI tracker no longer runs its own `inputProvenance.kind !== "inter_session"` check. It reads the message tool's `messageDelivery.sourceReplyDelivered` fact, which it already consumed. The duplicate branch is deleted. - The settle-wake instruction for yielded deliverables now says child results are not a message from the user, and the answer goes to the user of the original conversation, addressed to them directly. The #164860 case stays fixed: a WhatsApp/Telegram DM-scope main session gets `delivery.kind = "external"` during session init before its first agent turn (`src/auto-reply/reply/session.ts`), and Control UI turns do not replace an external record (`session-delivery.ts`, `metadata-projection.ts`). So a route-less inter-session turn there still gets the transcript-only receipt. Accepted edge (no code): a session used from both an external chat and the Control UI keeps today's behavior (transcript-only receipt on inter-session turns). Not changed: later assistant finals after a send are not hidden; the private-completion path and NO_REPLY policy for completion turns are unchanged. ## User impact Control UI users get one message, addressed to them, when a delegated task finishes. External-chat sessions behave as before. ## Evidence - Regression tests, red on merge base `59b0aec099f5`, green on head: - `message-tool.internal-source-reply.integration.test.ts` › "answers a Control UI user from an inter-session result turn": visible receipt and `sourceReplyDelivered: true`. - `cli-runner.reliability.test.ts` (via `cli-runner.reply-completion.test-support.ts`) › "ends a Control UI child-result turn at its final message-tool answer": real message tool, CLI run settles as success with one assistant row. - The #164860 test now seeds an external delivery record and still gets the transcript-only receipt (green on base and head). - Importers of every changed source: 47 test files that import a changed source or test-support file: all green (`ocx test`, vitest-source). `pnpm check:changed`: typecheck, lint, format and guards pass; the one red is the dead-export scan on `scripts/lib/docker-e2e-watchdog.mjs`, which this PR does not touch. - `pnpm prompt:snapshots:check` (clean HOME): current. ### Control UI E2E: before and after **Proof tier:** source (`ocx src`, pinned Bun fork). Two isolated scratch Gateways (merge base `59b0aec099f5` and head `5505abef8ce2`; the later head commit `56262188568a` changes only a test fixture type). Real Anthropic model (`anthropic/claude-sonnet-4-6`), driven through the Control UI in a browser. Embedded OpenClaw runtime. **Steps (same on both sides, fresh dashboard session per trial):** one prompt: "Delegate a quick schedule check to a child using sessions_spawn ..., wait with sessions_yield. When it finishes, send me the update with the message tool." The child runs `sleep 15` and reports. The requester-settle wake (`inter_session`, `subagent_settle`) sends a targetless `message` with `final: true`. | | Receipt on the settle wake (3/3) | Visible settle bubbles per trial | |---|---|---| | Before (merge base) | `Recorded reply in the current chat history via internal-ui. This send did not deliver it to an external channel.` | 1, **2**, 1 (the other two ended with hidden `NO_REPLY`) | | After (this PR) | `Sent visible reply to the current source conversation via internal-ui.` | 1, 1, 1 (no later model message in the settle run) | The duplicate on the base (trial 2) was a second model response in the same settle run: "Done! The child subagent finished its `sleep 15` and reported back. Here's the summary it delivered: ..." No empty-response or incomplete-turn errors on either side. **Gaps:** - Claude CLI runtime: real CLI runs worked on both sides, but in this scratch setup the settle-wake message tool did not receive inter-session provenance on the base either (base receipt was already "Sent visible ..."), so the live CLI runs did not reach the changed condition. The CLI path is covered by the regression test that drives the real CLI runner and the real message tool (`cli-runner.reliability.test.ts`, red on base, green on head). - The `sessions_send`-to-a-kept-child variant was not run; the spawn + yield variant reaches the same settle wake. - The model's wording varied; the head reply was a direct update to the user in each trial.   Diff: production +9 / −14 (one fact, one deleted tracker branch, one prompt line, one comment). Co-authored-by: Ayaan Zaidi <[email protected]>
…nclaw#204098) ## Problem In a Control UI chat, when a child finished and the parent sent its update with the `message` tool, the user saw two bubbles: the update, then a second, third-person one ("I sent the user the corrected dates... Still waiting on: ..."). Cause: the requester-settle wake is an inter-session turn. Since openclaw#164860, every inter-session internal-sink send was treated as transcript-only. The tool told the model "Recorded reply in the current chat history ... did not deliver it to an external channel", and neither the embedded delivery fact nor the Claude CLI tracker (openclaw#170534) counted the send as the turn's answer. A reply was still owed, so the model wrote an epilogue to the inter-session sender, and Control UI showed it as a normal assistant row. ## Solution - One fact, computed where the message tool is built: an internal-sink send is transcript-only only when the turn is inter-session **and** the session has an external delivery record (`sessionDeliveryChannel(entry)`, the same record `resolveAnnounceOrigin` treats as the external binding). It feeds the receipt and the embedded delivery fact (`messageDelivery.sourceReplyDelivered`). - The Claude CLI tracker no longer runs its own `inputProvenance.kind !== "inter_session"` check. It reads the message tool's `messageDelivery.sourceReplyDelivered` fact, which it already consumed. The duplicate branch is deleted. - The settle-wake instruction for yielded deliverables now says child results are not a message from the user, and the answer goes to the user of the original conversation, addressed to them directly. The openclaw#164860 case stays fixed: a WhatsApp/Telegram DM-scope main session gets `delivery.kind = "external"` during session init before its first agent turn (`src/auto-reply/reply/session.ts`), and Control UI turns do not replace an external record (`session-delivery.ts`, `metadata-projection.ts`). So a route-less inter-session turn there still gets the transcript-only receipt. Accepted edge (no code): a session used from both an external chat and the Control UI keeps today's behavior (transcript-only receipt on inter-session turns). Not changed: later assistant finals after a send are not hidden; the private-completion path and NO_REPLY policy for completion turns are unchanged. ## User impact Control UI users get one message, addressed to them, when a delegated task finishes. External-chat sessions behave as before. ## Evidence - Regression tests, red on merge base `43bef4fbcc7d`, green on head: - `message-tool.internal-source-reply.integration.test.ts` › "answers a Control UI user from an inter-session result turn": visible receipt and `sourceReplyDelivered: true`. - `cli-runner.reliability.test.ts` (via `cli-runner.reply-completion.test-support.ts`) › "ends a Control UI child-result turn at its final message-tool answer": real message tool, CLI run settles as success with one assistant row. - The openclaw#164860 test now seeds an external delivery record and still gets the transcript-only receipt (green on base and head). - Importers of every changed source: 47 test files that import a changed source or test-support file: all green (`ocx test`, vitest-source). `pnpm check:changed`: typecheck, lint, format and guards pass; the one red is the dead-export scan on `scripts/lib/docker-e2e-watchdog.mjs`, which this PR does not touch. - `pnpm prompt:snapshots:check` (clean HOME): current. ### Control UI E2E: before and after **Proof tier:** source (`ocx src`, pinned Bun fork). Two isolated scratch Gateways (merge base `43bef4fbcc7d` and head `5505abef8ce2`; the later head commit `56262188568a` changes only a test fixture type). Real Anthropic model (`anthropic/claude-sonnet-4-6`), driven through the Control UI in a browser. Embedded OpenClaw runtime. **Steps (same on both sides, fresh dashboard session per trial):** one prompt: "Delegate a quick schedule check to a child using sessions_spawn ..., wait with sessions_yield. When it finishes, send me the update with the message tool." The child runs `sleep 15` and reports. The requester-settle wake (`inter_session`, `subagent_settle`) sends a targetless `message` with `final: true`. | | Receipt on the settle wake (3/3) | Visible settle bubbles per trial | |---|---|---| | Before (merge base) | `Recorded reply in the current chat history via internal-ui. This send did not deliver it to an external channel.` | 1, **2**, 1 (the other two ended with hidden `NO_REPLY`) | | After (this PR) | `Sent visible reply to the current source conversation via internal-ui.` | 1, 1, 1 (no later model message in the settle run) | The duplicate on the base (trial 2) was a second model response in the same settle run: "Done! The child subagent finished its `sleep 15` and reported back. Here's the summary it delivered: ..." No empty-response or incomplete-turn errors on either side. **Gaps:** - Claude CLI runtime: real CLI runs worked on both sides, but in this scratch setup the settle-wake message tool did not receive inter-session provenance on the base either (base receipt was already "Sent visible ..."), so the live CLI runs did not reach the changed condition. The CLI path is covered by the regression test that drives the real CLI runner and the real message tool (`cli-runner.reliability.test.ts`, red on base, green on head). - The `sessions_send`-to-a-kept-child variant was not run; the spawn + yield variant reaches the same settle wake. - The model's wording varied; the head reply was a direct update to the user in each trial.   Diff: production +9 / −14 (one fact, one deleted tracker branch, one prompt line, one comment). Co-authored-by: Ayaan Zaidi <[email protected]>
…4098) ## Problem In a Control UI chat, when a child finished and the parent sent its update with the `message` tool, the user saw two bubbles: the update, then a second, third-person one ("I sent the user the corrected dates... Still waiting on: ..."). Cause: the requester-settle wake is an inter-session turn. Since #164860, every inter-session internal-sink send was treated as transcript-only. The tool told the model "Recorded reply in the current chat history ... did not deliver it to an external channel", and neither the embedded delivery fact nor the Claude CLI tracker (#170534) counted the send as the turn's answer. A reply was still owed, so the model wrote an epilogue to the inter-session sender, and Control UI showed it as a normal assistant row. ## Solution - One fact, computed where the message tool is built: an internal-sink send is transcript-only only when the turn is inter-session **and** the session has an external delivery record (`sessionDeliveryChannel(entry)`, the same record `resolveAnnounceOrigin` treats as the external binding). It feeds the receipt and the embedded delivery fact (`messageDelivery.sourceReplyDelivered`). - The Claude CLI tracker no longer runs its own `inputProvenance.kind !== "inter_session"` check. It reads the message tool's `messageDelivery.sourceReplyDelivered` fact, which it already consumed. The duplicate branch is deleted. - The settle-wake instruction for yielded deliverables now says child results are not a message from the user, and the answer goes to the user of the original conversation, addressed to them directly. The #164860 case stays fixed: a WhatsApp/Telegram DM-scope main session gets `delivery.kind = "external"` during session init before its first agent turn (`src/auto-reply/reply/session.ts`), and Control UI turns do not replace an external record (`session-delivery.ts`, `metadata-projection.ts`). So a route-less inter-session turn there still gets the transcript-only receipt. Accepted edge (no code): a session used from both an external chat and the Control UI keeps today's behavior (transcript-only receipt on inter-session turns). Not changed: later assistant finals after a send are not hidden; the private-completion path and NO_REPLY policy for completion turns are unchanged. ## User impact Control UI users get one message, addressed to them, when a delegated task finishes. External-chat sessions behave as before. ## Evidence - Regression tests, red on merge base `59b0aec099f5`, green on head: - `message-tool.internal-source-reply.integration.test.ts` › "answers a Control UI user from an inter-session result turn": visible receipt and `sourceReplyDelivered: true`. - `cli-runner.reliability.test.ts` (via `cli-runner.reply-completion.test-support.ts`) › "ends a Control UI child-result turn at its final message-tool answer": real message tool, CLI run settles as success with one assistant row. - The #164860 test now seeds an external delivery record and still gets the transcript-only receipt (green on base and head). - Importers of every changed source: 47 test files that import a changed source or test-support file: all green (`ocx test`, vitest-source). `pnpm check:changed`: typecheck, lint, format and guards pass; the one red is the dead-export scan on `scripts/lib/docker-e2e-watchdog.mjs`, which this PR does not touch. - `pnpm prompt:snapshots:check` (clean HOME): current. ### Control UI E2E: before and after **Proof tier:** source (`ocx src`, pinned Bun fork). Two isolated scratch Gateways (merge base `59b0aec099f5` and head `5505abef8ce2`; the later head commit `56262188568a` changes only a test fixture type). Real Anthropic model (`anthropic/claude-sonnet-4-6`), driven through the Control UI in a browser. Embedded OpenClaw runtime. **Steps (same on both sides, fresh dashboard session per trial):** one prompt: "Delegate a quick schedule check to a child using sessions_spawn ..., wait with sessions_yield. When it finishes, send me the update with the message tool." The child runs `sleep 15` and reports. The requester-settle wake (`inter_session`, `subagent_settle`) sends a targetless `message` with `final: true`. | | Receipt on the settle wake (3/3) | Visible settle bubbles per trial | |---|---|---| | Before (merge base) | `Recorded reply in the current chat history via internal-ui. This send did not deliver it to an external channel.` | 1, **2**, 1 (the other two ended with hidden `NO_REPLY`) | | After (this PR) | `Sent visible reply to the current source conversation via internal-ui.` | 1, 1, 1 (no later model message in the settle run) | The duplicate on the base (trial 2) was a second model response in the same settle run: "Done! The child subagent finished its `sleep 15` and reported back. Here's the summary it delivered: ..." No empty-response or incomplete-turn errors on either side. **Gaps:** - Claude CLI runtime: real CLI runs worked on both sides, but in this scratch setup the settle-wake message tool did not receive inter-session provenance on the base either (base receipt was already "Sent visible ..."), so the live CLI runs did not reach the changed condition. The CLI path is covered by the regression test that drives the real CLI runner and the real message tool (`cli-runner.reliability.test.ts`, red on base, green on head). - The `sessions_send`-to-a-kept-child variant was not run; the spawn + yield variant reaches the same settle wake. - The model's wording varied; the head reply was a direct update to the user in each trial.   Diff: production +9 / −14 (one fact, one deleted tracker branch, one prompt line, one comment). Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit a9c1dd8) Follow-ups: cded11f fix(agents): deliver a child's end state as parent history, not a turn obligation (#204178) [not selected for this narrow backport] Co-authored-by: RomneyDa <[email protected]>
Closes #164732
What Problem This Solves
Fixes: the agent believes a channel user received its reply when a target-less
message(action=send)in a route-less inter-session turn (for example a one-waysessions_sendresult turn on a WhatsApp-driven main session) only lands in the session transcript.User Impact
User impact: the tool result now tells the model that the reply was recorded in the session transcript and that this send did not reach an external channel, so the agent no longer reports a completion to a channel user who never saw it. Control UI sessions still see the reply as before.
Why This Change Was Made
When
shouldUseInternalSourceReplySinkpicks the private sink,handleInternalSourceReplySendActiononly persists the reply to the session transcript. No channel transport runs. Its receipt still saidSent visible reply to the current source conversation via internal-ui.for every send, including route-less turns where nobody watches Control UI. ClawSweeper's review on this issue confirmed the routing half is fixed on main by #162227 and that this receipt is the remaining defect.For a route-less inter-session result turn, the receipt now reads
Recorded reply in the current session transcript via internal-ui. This send did not deliver it to an external channel.(dry run:Prepared reply for the current session transcript.). The embedded attempt passes its input provenance to the message tool. The tool setssourceReplyTranscriptOnlyfor the runner only when that provenance isinter_session. The internal sink already means a targetless send with no external route. A WebChat user turn keeps main'sSent visible reply to the current source conversation via internal-ui.byte for byte, under both the automatic default andmessages.visibleReplies: "message_tool", since its user sees the transcript. CLI-backend and plugin-harness runs do not pass provenance to the message tool yet, so they keep main's receipt. Only the model-facing text changes. The structured details (deliveryStatus,sourceReplySink: "internal-ui", transcript ownership) stay as they are, so delivery tracking, payload projection, and the host's later forwarding of internal-ui payloads are untouched. The receipt describes only this call, since that forwarding can still reach an originating route after the run. The sink admission rules are also unchanged: telling a Control UI request apart from a route-less inter-session turn would change delivery ownership, which the review ruled out.Evidence
src/agents/tools/message-tool.internal-source-reply.integration.test.ts. It drives the realmessagetool with sessionagent:main:main,message_tool_only, and no target. On upstream/main b1880a0 it fails with the oldSent visible reply ... via internal-ui.text. On fix a982b53 it passes (8/8 in the file).message-tool.internal-source-reply.integration.test.ts8/8 (22.9s wall on the first fix wording),message-action-runner.broadcast.test.ts20/20 (9.0s, on the first fix wording). After review (3a4af75): the two files 30/30, with the Control UI receipt asserted equal to main, the route-less receipt tested at the tool and the runner, and an explicit-target send from a route-less run going through core delivery,sessions-send-tool.a2a.test.ts33/33 (8.5s). Alsomessage-tool.test.ts127/127 andmessage-tool.clawhub.integration.test.ts3/3.message-tool.test.ts,sessions-send-tool.a2a.test.ts,message-tool.clawhub.integration.test.tsandagent-tools.create-openclaw-coding-tools.test.tspass 228/228. A real Gateway run withmessages.visibleReplies: "message_tool"and a targetless WebChatchat.sendsend persistedRecorded reply ...on 3a4af75 andSent visible reply to the current source conversation via internal-ui.on 1d4c0f8. In the same run, the route-less turn kept the transcript wording and made 0 qa-channel sends.scripts/run-oxlint.mjsexit 0 andoxfmt --checkclean on the changed files.pnpm tsgo:coreandpnpm tsgo:core:testexit 0.git diff --checkclean.git grepfinds no other use of the old wording.Not verified: a live WhatsApp run of the original incident. ClawSweeper did not reproduce that routing failure on current main either.
Real behavior proof
An AI agent (Claude Code) ran one script against a real Gateway on one machine. It ran on the base b1880a0 (before) and on this branch a982b53 (after). Each commit got a fresh
scripts/run-node.mjsbuild.What was real:
createQaGatewayChild. It used themock-openaiprovider lane and a configuredqa-channelaccount.qa-channelaccount pointed at the repo's qa-lab bus (startQaBusServer) on 127.0.0.1, so it stood in for a real external channel. Every outbound channel send shows up there as anoutbound-messageevent.runAgentStepinsrc/agents/tools/agent-step.ts, the steprunSessionsSendA2AFlowuses, with its gateway caller bound to the child's RPC. It passed no delivery context, as in [Bug]: one-way sessions_send result turn sends target-less message to internal-ui sink and reports "Sent visible reply"; channel user never receives completion #164732. The Gateway gotagentwithsessionKey: "agent:qa:main",channel: "webchat",deliver: false,sourceReplyDeliveryMode: "message_tool_only"and inter-session provenance. Sessionagent:qa:mainhas no channel route.messagetool,shouldUseInternalSourceReplySink,handleInternalSourceReplySendAction, transcript persistence, and replay of the session history to the model on the next turn.What was faked:
message({"action":"send","message":"PROOF-164860 child task finished: report is ready."}), with no target. It logged eachfunction_call_outputreplayed to it.Run order: the route-less turn, then a follow-up turn on
agent:qa:mainso the model's next request replays the tool result, then a control turn on another session. In the control turn the model sends with an explicit target (channel: "qa-channel",target: "dm:proof-user").Sent visible reply to the current source conversation via internal-ui.Recorded reply in the current session transcript via internal-ui. This send did not deliver it to an external channel.agent:qa:mainPROOF-164860 child task finished: report is ready.,provider: "openclaw",model: "delivery-mirror"toolResultdetailsdeliveryStatus: "sent",channel: "webchat",target: "current-run",sourceReplySink: "internal-ui",sourceReplyTranscriptOwner: true,messageDelivery.status: "settled"outbound-messageevents after the route-less and follow-up turnsoutbound-messageevents after the control turndm:proof-user, the control text)The rows come from the
transcript_eventstable of the child's agent SQLite database, read after the follow-up turn and before the control turn. On both commits the route-less send writes the same records in the same order: the tool call, the delivery-mirror assistant message, then the tool result. Only the tool result text differs. The control turn shows that the bus records a real channel send when one happens, so the 0 for the route-less turn is a real absence and not a blind spot.Not verified: a live WhatsApp run of the original incident, or a real model. The requester turn came from
runAgentStepdriven by the script, not from asessions_sendtool call in a parent session. The model's replies were scripted.Merged-head verification (2026-10-07)
Merged main
8fffecae086167a7325a5053c212f68bc8686dd2without rebasing. Current candidate:be1ae9d4eb6cbdedde7aa6c79280a59c01ac45ab.MessageActionInput: the receipt-only discriminator stays in its local intersection alongside source-reply fields, not in the shared outbound payload contract. The message-tool options and embedded-attempt provenance plumbing remain connected. No routing or public-contract changes.pnpm tsgopassed. Both complete acceptance test files passed 34/34, including main's additional cases (50.16 s Vitest / 81.14 s wrapper wall).messagetool-result event contains the corrected transcript-only receipt, withsourceReplyTranscriptOwner: trueand settled delivery metadata. Route-less qa-channel outbound count: 0. Routed control: 1, with the same receipt as the recorded baseline except per-send UUID/time.gpt-5-minicontinuation, reasoninglow, output budget 4096, over this build's actual tool-result event. It said: “I can’t send external messages from here, but I’ve recorded the reply internally in the session.” As below, the preceding Gateway tool choice was scripted.Pushed with contributor history preserved. CI passed on the merged head, and ClawSweeper is ready on that exact SHA. No failing jobs. The single cancelled PR-context job from run 37566917870 is covered by successful replacement run 37566963312 on the same SHA; no test shard was cancelled.
Maintainer verification (2026-10-07)
Verified the unchanged head
1d4c0f8f18b768126425fbed2ddbe49e2c22f4adagainst current mainc48607980ace9d7509cec7158cc43f12accc721fin isolated Node 24 Docker containers, with Gateway state on tmpfs. No overlap with Pash/Sarah changes.sessions_sendthrough the deferred tool surface to a separate subagent session B, withtimeoutSeconds: 0. B completed; its one-way result continuation in A invoked the real targetlessmessage(action=send). The model stimulus was scripted; session dispatch, result continuation, tool execution, transcript writes, and the qa-channel transport were production paths.Sent visible reply to the current source conversation via internal-ui.On this head:Recorded reply in the current session transcript via internal-ui. This send did not deliver it to an external channel.Both recorded the reply and produced zero qa-channel outbound messages.qa-channel/dm:proof-usersend produced one outbound message on each build. Its tool result was identical after excluding only the per-send message UUID and timestamp.pnpm tsgopassed.gpt-5-minicall used reasoninglowandmax_output_tokens: 4096, continuing from the actual candidate transcript's targetless tool call and receipt. It stated: “I recorded the reply in the session transcript (internal note)” and did not claim external delivery. This was a provider continuation over captured Gateway evidence, not a live-model-driven Gateway send; the preceding send was scripted.ready. The single cancelledPR context and evidencerun (37212656871) is covered by its successful replacement on the same SHA (37212691904); it was not a cancelled test shard.No delivery routing, public SDK, or Gateway protocol change was made. No WhatsApp or Telegram live-delivery claim. Contributor commits and credit are unchanged.
Test cost
pnpm test src/agents/tools/message-tool.internal-source-reply.integration.test.ts src/infra/outbound/message-action-runner.broadcast.test.ts --maxWorkers=1on a982b53 passes 28/28 (8 + 20). Wall time is 31.9 s cold and 16.1 s warm (Vitest reports 12.4 s and 11.8 s). The new case takes 3 ms.AI disclosure: an AI agent (Claude Code) reproduced the receipt defect with the test above, wrote the test and the fix, had a second model review the diff, and ran the gates listed:
pnpm teston each file named,scripts/run-oxlint.mjs,oxfmt --check,pnpm tsgo:core,pnpm tsgo:core:test, andgit diff --check. It also ran the real Gateway runs in Real behavior proof.🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309.