Skip to content

[Bug]: Native tool-call assistant text is dropped from draft updates #3974

@whtiehack

Description

@whtiehack

Affected component

channel

Severity

S2 - degraded behavior

Current behavior

When a provider uses native tool calling and returns both assistant text and structured tool_calls, draft-capable channel updates only receive the tool-progress message. The assistant explanation text is dropped before it reaches on_delta.

On current master, resolve_display_text() returns parsed_text for any turn that contains tool calls. Native tool-call turns often have empty parsed_text, so the assistant's separate text payload is lost.

Expected behavior

For native tool-call turns, if there is no parsed inline text but the provider returned assistant text, that text should be preserved and relayed through on_delta before tool execution starts.

Steps to reproduce

  1. Check out the latest master branch. I reproduced this on commit 65cb4fe0.
  2. Configure Telegram with draft streaming enabled.
  3. Trigger a native tool-call response where the provider returns assistant text alongside structured tool calls, for example:
{
  "text": "Task started. Waiting 30 seconds before checking status.",
  "tool_calls": [
    {
      "id": "call_wait",
      "name": "count_tool",
      "arguments": "{\"value\":\"A\"}"
    }
  ]
}
  1. Observe the streamed draft output in Telegram.
  2. The tool-progress line is emitted, but the assistant text above is missing.

Impact

Affected users: Telegram users with streaming drafts enabled, and any other draft-capable channel consuming on_delta
Frequency: whenever the provider returns separate assistant text plus structured tool_calls
Consequence: users see tool execution progress without the model's accompanying explanation or status message

Logs / stack traces

Observed symptom in streamed output:

💬 Got 1 tool call(s)
⏳ count_tool: {"value":"A"}
✅ count_tool

Expected streamed output should also include the assistant text before tool execution, for example:

Task started. Waiting 30 seconds before checking status.
💬 Got 1 tool call(s)
⏳ count_tool: {"value":"A"}
✅ count_tool

ZeroClaw version

master @ 65cb4fe0

Rust version

rustc 1.93.1 (01f6ddf75 2026-02-11)

Operating system

macOS 12.7.4

Regression?

Unknown

Pre-flight checks

  • I reproduced this on the latest master branch or latest release.
  • I redacted secrets, tokens, and personal data from all submitted content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions