Skip to content

[Bug] GLM 5.3 web search tool emits raw unparsed XML markup <tool_call>search... and crashes/stalls session #867

Open

Description

@romangalaxys10-spec

Bug Description

When users interact with GLM-5.3 on chat.z.ai on prompts that invoke online sources/web search, the model frequently leaks raw, unparsed tool-call XML directly into the chat stream instead of triggering the built-in search execution pipeline:

<tool_call>search<arg_key>search_query</arg_key><arg_value>[{"q": "octopus hunting methods..."}]</arg_value></tool_call>

or

<tool_call>retrieve<arg_key>retrieve</arg_key><arg_value>[{"q": "Neo-Gothic cathedral dome design..."}]</arg_value></tool_call>

Once this raw markup leaks into the chat turn, the conversation degrades: latency spikes, subsequent turns repeatedly emit malformed tool syntax, and the session eventually stalls or breaks.


Source & Attribution


Reproduction & Characteristics

  1. Ask GLM-5.3 a query requiring web search or retrieval of online sources (reproduced across varied topics: biology, architecture, etc.).
  2. The model outputs raw <tool_call>search... or <tool_call>retrieve... tags directly into the message text rather than having the tool-use parser capture the call.
  3. User reports that opening a fresh session does not permanently fix it:

    "does that two in a new session first post as well... i noticed its getting slowly worse... this type of error message topic changes but somthing is fundemetly broken"

  4. Upstream Mechanism: Indicates a failure in the chat completion streaming parser / function calling interceptor on the gateway, where custom GLM tool tokens (<tool_call>...) bypass the tool-parser regex/state machine and leak into the content channel.

Expected Behavior

  • Tool calls should be intercepted by the web serving gateway, executed behind the scenes, and injected as tool response turns.
  • Raw tool-call tags (<tool_call>, <arg_key>, <arg_value>) should never leak into user-facing content tokens.

Activity

  1. github-actions commented on Sep 29, 2026

    @github-actions

    👋 感谢你的反馈,我们已经收到。

    • 维护者看到后会尽快回复你。
    • 状态保持为 status: 待评估,你可以随时补充信息。
    • 信息不全时我们会打上 needs: 更多信息 标签并 @ 你。

    👋 Thanks — we've received your issue.

    • A maintainer will get back to you as soon as we can.
    • Status stays at status: 待评估 (Triage); feel free to add context.
    • If we need more details, we'll add needs: 更多信息 and ping you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions