AI API receipt · sgl-project/sglang

DeepSeekV3Detector streaming drops the first tool call when two complete calls arrive in one increment

sgl-project/sglang#43523 · upstream bug reproduced by running the issue's own reproduction

Badgr cannot tell this response is wrong

Two complete tool calls arrived together; the streaming parser returned only get_tourist_attractions and never get_weather (reproduced on the SGLang nightly image; non-streaming returns both).

one complete, schema-valid tool call satisfies a required tool call; Badgr cannot know a second call was expected. If the caller supplies the expected calls (get_weather for Paris and get_tourist_attractions for Tokyo), Badgr rejects it: expected tool call is missing. The receipt therefore records success. This is a limit of what the contract can prove, shown here so it is not mistaken for protection.

What the upstream returned (replayed)

The output the bug produces, taken from the issue’s reproduction and fed to Badgr’s validators. Not a live provider call.

tool_calls: [{"type": "function", "function": {"name": "get_tourist_attractions", "arguments": "{\"city\": \"Tokyo\"}"}}]
tools: ["get_weather", "get_tourist_attractions"]
tool_choice: "required"

Badgr receipt

Written by Badgr’s receipt ledger and read back from GET /v1/receipts/replay-sglang-43523-dropped-first-tool-call.

{
  "request_id": "replay-sglang-43523-dropped-first-tool-call",
  "status": "success",
  "endpoint": "/v1/chat/completions",
  "stream": false,
  "failure_stage": null,
  "error_code": null,
  "error_message": null,
  "retryable": null,
  "provider_mode": "replay",
  "routing_decision": "replayed_upstream_output",
  "created_at": "1791652209.5882711"
}

Recorded 2026-10-11 in Badgr’s local development environment. Replay cases and verdicts are pinned by backend/test_ai_api_replay_cases.py.

← All AI API receipts