Skip to content

Bug: Discord streamed reply disappears after tool-call failure warning #83831

@aounakram

Description

@aounakram

Bug: Discord streamed assistant reply disappears after a tool-call failure warning

Summary

In a Discord channel using the Pi runtime with Discord streaming enabled, an assistant final text reply can appear briefly and then disappear when the same turn also has a failed tool call. The only visible message left in Discord is the tool failure warning.

This looks like a Discord delivery/render lifecycle bug, not a model failure: the assistant generated and delivered text momentarily, but it was later replaced/removed after the failed tool notification finalized.

Environment

  • OpenClaw: 2026.5.18 (50a2481)
  • OS: macOS 26.3.1 arm64
  • Node: 25.8.1
  • Channel: Discord guild text channel
  • Runtime/model: Pi runtime, openai-codex/gpt-5.5
  • Gateway log line for these turns shows: provider=openai-codex/gpt-5.5 harness=pi configured=unspecified
  • Discord streaming is enabled with channels.discord.streaming.mode = partial
  • Agent model overrides include agentRuntime.id = pi for both openai/gpt-5.5 and openai-codex/gpt-5.5

Repro

  1. In Discord, ask the assistant to perform a harmless invalid lookup/tool call and then still reply with a normal text response.

  2. The assistant runs a harmless invalid command:

    openclaw definitely-not-a-real-subcommand
  3. The command fails in the agent tool runner. In this environment the shell output was:

    zsh:1: command not found: openclaw
    
  4. The assistant then sends a normal final text reply:

    delivery survived
    

Actual behavior

  • delivery survived appeared in Discord momentarily.

  • Then that assistant text disappeared.

  • The only message that remained visible was the tool failure warning:

    ⚠️ 🛠️ `run openclaw definitely-not-a-real-subcommand (agent)` failed
    

Expected behavior

The tool failure warning should not remove or supersede the assistant final response. Both should remain visible, or the final assistant response should remain authoritative while the failure warning is shown separately.

Notes

  • This is reproducible with Pi runtime + Discord partial streaming.
  • The symptom suggests the Discord message lifecycle for turns containing failed tool calls may be editing/deleting/replacing the streamed assistant reply with the tool failure notice.
  • The important part is that the assistant response did stream/render briefly, so the failure appears to be in post-tool-failure Discord delivery/render finalization rather than generation.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions