Skip to content

Dingo router fix tool streaming - #73

Merged
guojn1 merged 3 commits into
DingoRouter-basefrom
DingoRouter-fix-tool-streaming
Sep 25, 2026
Merged

guojn1 merged 3 commits into
DingoRouter-basefrom
DingoRouter-fix-tool-streaming

Conversation

@githubgxll

Copy link
Copy Markdown
Owner

No description provided.

guojn1 and others added 2 commits September 23, 2026 15:00
…ng until finish

Client-side TTFT of pure tool-call streaming requests was effectively
equal to the whole generation time: the post-processor only attached
accumulated tool_calls to the finish chunk, and content-less deltas
were suppressed, so no bytes reached the client during generation
(Nexus TTFT/total median ~99.6%/97.4% vs ~17.2% for native SGLang).

The post-processor now emits OpenAI tool_call deltas as the parser
produces them: the id+name delta goes out with the first argument
fragment and argument fragments stream as they arrive (the un-emitted
tail of the accumulated arguments is the source of truth, so event
granularity cannot produce duplicates).

Correctness guards from the buffered design are retained:

- names without any argument fragment are never emitted, so a
  misidentified prompt word cannot leak as a dangling call;
- unknown tool names (not in the request's tool list) are suppressed
  mid-stream and purged at finish, exactly as before;
- the finish-time full-text re-parse remains authoritative, now in
  merge mode: argument suffixes for partially streamed calls are
  patched (with streamed indices kept stable), calls the streaming
  parser missed are appended under fresh indices, and when nothing
  was streamed the re-parse rebuilds state exactly as before;
- malformed (non-JSON) accumulated arguments of already-streamed
  calls can no longer be retracted, so they now trigger the
  finish-time re-parse for authoritative recovery instead of being
  silently dropped; finish_reason is still rewritten to tool_calls
  when a call was emitted.

Tests: existing assertions now reassemble the delta stream per the
client contract (semantic regression), plus new cases locking the
TTFT contract (deltas arrive before the finish chunk, first entry
carries id+name, distinct indices/ids for parallel calls) and the
new malformed/unknown-name streaming contract.  Not executed locally
(no sglang env); run on gpu_1 CI.
@githubgxll
githubgxll deployed to external_collaborator September 23, 2026 09:29 — with GitHub Actions Active
@guojn1
guojn1 merged commit 3222887 into DingoRouter-base Sep 25, 2026
4 of 6 checks passed

This branch had an error being deployed

1 failed deployment
external_collaborator — d22fac41 Deployed Sep 23, 2026 by githubgxll via ok-to-test #130
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.

2 participants