Skip to content

Workflow responses leak internal <function_calls> scaffolding into user-visible chat #47444

@5toCode

Description

@5toCode

Summary

In workflow-style sessions, user-visible replies sometimes include internal tool-call scaffolding instead of only the clean final result.

Example

User sees leaked content like:

<function_calls>
<invoke name="exec">
<parameter name="command">cd /Users/mikeroberts/.openclaw/workspace && node scripts/knowledge-store.mjs search --query "what skills matter most in the age of AI" --limit 4</parameter>
<parameter name="yieldMs">10000</parameter>
</invoke>
</function_calls>
<function_response>
Searching for: "what skills matter most in the age of AI"
...
</function_response>

Important note

The underlying workflow is often working correctly. In this case, the semantic search result quality was good. The problem is that the user-facing reply is polluted with raw internal tool envelopes and command text.

Expected

Only the final human-readable answer should be shown to the user.

Actual

Internal tool-call scaffolding is included in the user-visible response:

  • <function_calls>
  • <invoke ...>
  • <function_response>
  • raw command text
  • intermediate internal execution output

Impact

  • confusing and noisy UX
  • exposes internal implementation details
  • makes workflows feel broken even when results are correct
  • damages trust in agent responses

Context

Observed in Telegram workflow/agent sessions such as Second Brain, but likely not limited to that workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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