Skip to content

test: reject reasoning_content and tool_calls in the same M3.1-Flash stream delta - #95

Open
annora wants to merge 7 commits into
MiniMax-AI:mainfrom
annora:test/m31f-sse-reasoning-tool-call-same-delta
Open

annora wants to merge 7 commits into
MiniMax-AI:mainfrom
annora:test/m31f-sse-reasoning-tool-call-same-delta

Conversation

@annora

@annora annora commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Adds TestSSEStream::test_02_25_reasoning_content_and_tool_calls_not_coexist_in_chunk to the M3.1-Flash stream suite: a stream delta that carries tool_calls must not carry reasoning_content.

The M3 stream emits reasoning and the assistant turn in separate phases (see 02_07 for content). A delta that mixes the tail of the reasoning with a tool-call fragment breaks clients that handle one field per delta (for example if reasoning_content ... elif tool_calls ...): either the reasoning text or the tool-call fragment is dropped, and a dropped first fragment loses the call's id and name. It can also deliver reasoning after the tool call has started.

Case design

  • reasoning_effort=high with the echo tool and a prompt that asks for reasoning followed directly by the tool call with no text around it, so the stream crosses the reasoning-to-tool-call boundary.
  • The violation only appears on some responses, so the request is sent 10 times and the first violating run fails the case (same loop shape as 02_07).

Assertions

  • Every run returns a successful stream.
  • No delta carries tool_calls together with reasoning_content; the field must be absent or null, and an empty string counts as present (clients that branch on the field's presence would otherwise take the reasoning path and drop the tool-call fragment).
  • The failure message gives the run number, the trace_id and the offending deltas.

Docs

docs/m3_stream_cases.md and docs/m3_stream_cases_en.md gain the 02_25 row and mention it in the TestSSEStream scope.

zhaoming added 7 commits November 20, 2026 18:21
… stream delta

assert_sse_stream_strict now fails when one delta carries both non-empty
reasoning_content and tool_calls. 02_12 gains a tool_after_reasoning
scenario (reasoning_effort=high) that crosses the reasoning-to-tool-call
boundary.
… 10-run case 02_25

Follow the 02_07 loop shape: send the request 10 times and fail on the first
violating run. 02_12 keeps its original scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant