AI API receipt · sgl-project/sglang

HermesDetector reorders streamed normal text across a tool call

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

Badgr cannot tell this response is wrong

The model's text "a</bdone" was streamed as "ab</done": the "</" jumped to after the tool call.

the text is non-empty and every tool call is complete; text ordering is not something the contract can verify. If the caller supplies the expected value (text == "a</bdone"), Badgr rejects it: response text does not match the expected text. 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.

data: {"choices": [{"index": 0, "delta": {"content": "a"}, "finish_reason": null}]}
data: {"choices": [{"index": 0, "delta": {"content": "b"}, "finish_reason": null}]}
data: {"choices": [{"index": 0, "delta": {"tool_calls": [{"index": 0, "function": {"arguments": "{}", "name": "get_weather"}}]}, "finish_reason": null}]}
data: {"choices": [{"index": 0, "delta": {"content": "</done"}, "finish_reason": "tool_calls"}]}
data: [DONE]

Badgr receipt

Written by Badgr’s receipt ledger and read back from GET /v1/receipts/replay-sglang-43148-reordered-text.

{
  "request_id": "replay-sglang-43148-reordered-text",
  "status": "success",
  "endpoint": "/v1/chat/completions",
  "stream": true,
  "failure_stage": null,
  "error_code": null,
  "error_message": null,
  "retryable": null,
  "provider_mode": "replay",
  "routing_decision": "replayed_upstream_output",
  "created_at": "2026-10-09T02:14:36Z"
}

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

← All AI API receipts