Skip to content

test: add tool_arg trailing-newline stream test (16_15)#36

Open
huahua-ctrl wants to merge 1 commit into
MiniMax-AI:mainfrom
huahua-ctrl:feat/tool-arg-trailing-newline
Open

test: add tool_arg trailing-newline stream test (16_15)#36
huahua-ctrl wants to merge 1 commit into
MiniMax-AI:mainfrom
huahua-ctrl:feat/tool-arg-trailing-newline

Conversation

@huahua-ctrl

Copy link
Copy Markdown
Contributor

Add TestToolCallEdge::test_16_15_tool_arg_string_trailing_newline covering a common real-agent scenario: a Write-style tool whose content string argument must end with a literal \n. If the model or the service stack silently rstrips trailing whitespace off tool arguments, content comes back as hello\nworld (11 chars) instead of hello\nworld\n (12 chars), and downstream file writers create malformed POSIX text files.

The case uses stream=True only. Rationale: stream is where the tail-token loss (last chunk dropped on stop) surfaces — the same failure mode as the existing SILENCE case (test_12_07_silence_literal_stream). Non-stream is covered by the model behavior alone, which we already exercise indirectly via the other 14_/16_ cases.

Add TestToolCallEdge::test_16_15_tool_arg_string_trailing_newline covering
a common real-agent scenario: a Write-style tool whose `content` string
argument must end with a literal `\n`. If the model or the service stack
silently rstrips trailing whitespace off tool arguments, `content` comes
back as `hello\nworld` (11 chars) instead of `hello\nworld\n` (12 chars),
and downstream file writers create malformed POSIX text files.

The case uses stream=True only. Rationale: stream is where the tail-token
loss (last chunk dropped on stop) surfaces — the same failure mode as the
existing SILENCE case (test_12_07_silence_literal_stream). Non-stream is
covered by the model behavior alone, which we already exercise indirectly
via the other 14_/16_ cases.

Cross-provider run against 10 direct providers (bodies match the pinned
M3.postman collection) shows a consistent split:
  - PASS: M3-test / fireworks x2 / inferact x2 / magikcloud / modular
  - FAIL: together GB300 / fp4 / B200 — all three return
          {"content":"hello\nworld"} (11 chars, tail \n dropped)

This matches together's SILENCE case failure (tail `]` dropped) and gives
provider verifier two independent probes for the same class of "tail
character eaten on tool_call arguments stream" bug.

Co-Authored-By: Claude <noreply@anthropic.com>
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