Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Discord source-channel turns that deliver the visible reply via message(action=send) can still append a separate stale tool-failed warning after the successful user-visible response.
Steps to reproduce
- Run OpenClaw with Discord enabled and a Discord source channel using source-reply delivery through the
message tool (message_tool_only path).
- Trigger a Discord turn where an earlier tool call fails, but the agent later sends the final user-visible Discord reply successfully with
message(action=send).
- Observe the Discord channel after the successful reply.
Expected behavior
Once the final response has been successfully delivered to Discord through message(action=send), OpenClaw should treat the turn as having a user-facing assistant reply and should not append a stale fallback tool-error warning for an earlier non-terminal tool failure.
Actual behavior
The user-visible Discord reply is delivered successfully, but a separate tool-failed warning can appear after it. This makes the turn look failed even though the final Discord response was sent.
OpenClaw version
Observed on 2026.6.1. The current 2026.6.8 source still appears to have the same accounting gap in src/agents/embedded-agent-runner/run/payloads.ts.
Operating system
Ubuntu 24.04
Install method
npm global
Model
OpenAI/Codex-backed model route
Provider / routing chain
OpenClaw gateway -> OpenAI/Codex-backed agent runtime
Additional provider/model setup details
No provider-specific behavior was required to reproduce the symptom. The relevant condition is Discord source delivery through the message tool plus an earlier failed tool call in the same turn.
Logs, screenshots, and evidence
Sanitized observed sequence:
1. Discord source turn enters message_tool_only delivery mode.
2. One or more earlier tool calls fail during the turn.
3. The assistant successfully sends the visible final response through message(action=send).
4. After that visible response, Discord receives an additional tool-failed warning payload.
Source-level evidence from current main / 2026.6.8:
const hasSourceReplyPayload = replyItems.length > sourceReplyStartIndex;
const deliveredSourceReplyViaMessageTool =
params.sourceReplyDeliveryMode === "message_tool_only" &&
params.didDeliverSourceReplyViaMessageTool === true;
const suppressAssistantArtifacts =
params.didSendDeterministicApprovalPrompt === true ||
hasSourceReplyPayload ||
deliveredSourceReplyViaMessageTool;
// Later:
let hasUserFacingAssistantReply = hasSourceReplyPayload;
deliveredSourceReplyViaMessageTool suppresses duplicate assistant artifacts, but it is not included in the hasUserFacingAssistantReply gate that is passed to resolveToolErrorWarningPolicy. In the 2026.6.1 published bundle, the same gap existed with direct message-tool evidence (didSendViaMessagingTool) not counting as a user-facing reply.
A local mitigation for the published 2026.6.1 bundle was to count successful direct message-tool delivery as user-facing reply evidence:
let hasUserFacingAssistantReply =
hasSourceReplyPayload || params.didSendViaMessagingTool === true;
For current main, the equivalent fix likely needs to account for deliveredSourceReplyViaMessageTool as well.
Impact and severity
Affected: Discord source-channel users where final replies are delivered through the message tool.
Severity: Moderate. The final response can be delivered, but users see a misleading failure message after every affected tool-use turn.
Frequency: Reproduced on affected Discord tool-use turns with earlier tool failures and successful final message(action=send) delivery.
Consequence: Users lose trust in successful tool-use responses because the channel shows an apparent failure after the successful answer.
Additional information
This does not appear to be a security issue; it is a user-visible delivery/accounting bug. No private logs, channel IDs, user IDs, tokens, hostnames, session IDs, or local filesystem paths are included in this report.
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Discord source-channel turns that deliver the visible reply via
message(action=send)can still append a separate stale tool-failed warning after the successful user-visible response.Steps to reproduce
messagetool (message_tool_onlypath).message(action=send).Expected behavior
Once the final response has been successfully delivered to Discord through
message(action=send), OpenClaw should treat the turn as having a user-facing assistant reply and should not append a stale fallback tool-error warning for an earlier non-terminal tool failure.Actual behavior
The user-visible Discord reply is delivered successfully, but a separate tool-failed warning can appear after it. This makes the turn look failed even though the final Discord response was sent.
OpenClaw version
Observed on 2026.6.1. The current 2026.6.8 source still appears to have the same accounting gap in
src/agents/embedded-agent-runner/run/payloads.ts.Operating system
Ubuntu 24.04
Install method
npm global
Model
OpenAI/Codex-backed model route
Provider / routing chain
OpenClaw gateway -> OpenAI/Codex-backed agent runtime
Additional provider/model setup details
No provider-specific behavior was required to reproduce the symptom. The relevant condition is Discord source delivery through the
messagetool plus an earlier failed tool call in the same turn.Logs, screenshots, and evidence
Sanitized observed sequence:
Source-level evidence from current
main/ 2026.6.8:deliveredSourceReplyViaMessageToolsuppresses duplicate assistant artifacts, but it is not included in thehasUserFacingAssistantReplygate that is passed toresolveToolErrorWarningPolicy. In the 2026.6.1 published bundle, the same gap existed with direct message-tool evidence (didSendViaMessagingTool) not counting as a user-facing reply.A local mitigation for the published 2026.6.1 bundle was to count successful direct message-tool delivery as user-facing reply evidence:
For current
main, the equivalent fix likely needs to account fordeliveredSourceReplyViaMessageToolas well.Impact and severity
Affected: Discord source-channel users where final replies are delivered through the
messagetool.Severity: Moderate. The final response can be delivered, but users see a misleading failure message after every affected tool-use turn.
Frequency: Reproduced on affected Discord tool-use turns with earlier tool failures and successful final
message(action=send)delivery.Consequence: Users lose trust in successful tool-use responses because the channel shows an apparent failure after the successful answer.
Additional information
This does not appear to be a security issue; it is a user-visible delivery/accounting bug. No private logs, channel IDs, user IDs, tokens, hostnames, session IDs, or local filesystem paths are included in this report.