Repository navigation
Description
Summary
OpenClaw is sometimes surfacing raw internal tool/runtime plumbing messages directly into user chat instead of suppressing or rewriting them into safe, human-readable replies.
This is happening frequently enough in production chat usage to be a systemic UX/runtime bug, not an isolated incident.
Examples observed
Raw messages leaking into Discord chat include things like:
No tool call found for function call output with call_id ...- raw exec completion noise / internal process completion lines
- other internal tool/output mismatch artifacts that appear to be runtime plumbing rather than user-facing assistant output
Expected behavior
Internal runtime/tool-call mismatches, orphaned tool outputs, exec completion notices, and similar plumbing artifacts should not be delivered raw to end-user chat.
They should instead be handled by one of:
- suppressed entirely if non-user-actionable
- logged internally only
- rewritten into a human-readable assistant message when user-facing context is actually needed
Actual behavior
These raw internal messages can appear directly in the chat thread, which:
- leaks implementation detail
- creates noise/confusion for end users
- makes the assistant appear unstable even when the underlying task succeeded
- suggests some runtime-generated events are bypassing the normal user-facing response sanitization path
Impact
High UX impact. In our environment this is not rare. It appears often enough to erode trust in the chat surface.
Suspected root cause
Likely a message-plumbing / event-routing issue where runtime-generated tool or exec events can become user-visible replies without passing through the same filtering/sanitization/rewrite layer as normal assistant output.
The specific leaked string:
No tool call found for function call output with call_id ...
suggests an orphaned or mismatched tool result is being surfaced directly instead of being quarantined.
Requested fix
Please add a guardrail in the runtime/chat delivery path so that internal-only events and tool/runtime error artifacts are never emitted raw to chat.
A robust fix would likely:
- classify internal/runtime/tool-plumbing events separately from user-visible assistant replies
- suppress known internal event classes from channel delivery
- provide a safe fallback rewrite for cases where the user should be informed that an internal execution problem occurred
- add regression tests for orphaned tool outputs / call_id mismatches / exec completion artifacts
Repro notes
The exact trigger appears to involve tool/runtime mismatch paths rather than one specific user prompt. The leak occurs during normal chat operation when tool or exec plumbing hits an edge case.
Environment
- OpenClaw chat usage in Discord
- Runtime-generated internal events are visible on the user-facing surface
If helpful, I can follow up with additional examples once I finish tracing the local runtime path.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Ryce commentedon Mar 20, 2026
steipete commentedon Apr 25, 2026
Closing this as implemented after Codex review.
Current
mainalready has the requested guardrails: commentary-phase assistant text is suppressed before delivery, assistant-visible text is sanitized before channel emission, internal runtime context blocks are stripped, and orphaned tool results are dropped by replay sanitization. The relevant guardrail files are unchanged betweenv2026.4.22and currentmain, so this appears to have shipped in that release.What I checked:
handleMessageUpdatereturns immediately forcommentaryphase, andhandleMessageEndexits before emitting any user-visible reply for commentary messages. (src/agents/pi-embedded-subscribe.handlers.messages.ts:457, 6944d7025d9c)finalizeAssistantExtractionroutes assistant-visible text throughsanitizeUserFacingText, which strips internal runtime context and rewrites raw runtime/API errors into friendly UI copy. (src/agents/pi-embedded-utils.ts:37, 6944d7025d9c)src/agents/internal-runtime-context.ts:1, 6944d7025d9c)src/agents/pi-embedded-runner/run/attempt.tool-call-normalization.test.ts:6, 6944d7025d9c)git diff --name-only v2026.4.22..HEADover the core delivery/sanitization files (src/agents/pi-embedded-subscribe.handlers.messages.ts,src/agents/pi-embedded-utils.ts,src/agents/internal-runtime-context.ts, and the related regression tests) returned no changes, so these guardrails were already present inv2026.4.22. (6944d7025d9c)So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against 6944d7025d9c; fix evidence: release v2026.4.22.