Environment
- Model: kimi-k2-thinking
Description
When using the kimi-k2-thinking model with streaming enabled (stream=True), I’ve observed that special tool-calling tokens such as <|tool_calls_section_begin|> appear within the reasoning_delta stream. This causes parsing failures in standard agent frameworks that expect reasoning_content to contain only natural language reasoning text.
Expected Behavior
According to the official documentation:
reasoning_contentshould contain the model’s thinking/reasoning process- Tool calls should be properly structured in the
tool_callsfield - Special tokens like
<|tool_calls_section_begin|>should be part of the internal token structure, …
Environment
- Model: kimi-k2-thinking
Description
When using the kimi-k2-thinking model with streaming enabled (stream=True), I’ve observed that special tool-calling tokens such as <|tool_calls_section_begin|> appear within the reasoning_delta stream. This causes parsing failures in standard agent frameworks that expect reasoning_content to contain only natural language reasoning text.
Expected Behavior
According to the official documentation:
reasoning_contentshould contain the model’s thinking/reasoning process- Tool calls should be properly structured in the
tool_callsfield - Special tokens like
<|tool_calls_section_begin|>should be part of the internal token structure, not exposed in the reasoning stream
Actual Behavior
The reasoning_delta field contains raw special tokens:
stream log from our side