Skip to content

[PD] Preserve bootstrap metadata in native Messages requests - #39711

Merged
hnyls2002 merged 4 commits into
sgl-project:mainfrom
chromecast56:codex/native-messages-pd-bootstrap
Sep 29, 2026
Merged

hnyls2002 merged 4 commits into
sgl-project:mainfrom
chromecast56:codex/native-messages-pd-bootstrap

Conversation

@chromecast56

@chromecast56 chromecast56 commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related entrypoints PRs: #40077, #39716. Each is independent and they can merge in any order.

Motivation

Native /v1/messages requests drop the PD rendezvous fields when they are converted to ChatCompletionRequest, so a decode worker never receives the bootstrap metadata a PD router sends. smg now routes /v1/messages through PD dual dispatch and injects those fields (smg-project/smg#2250); this is the worker-side change that makes that path work.

Modifications

  • Add bootstrap_host, bootstrap_port, bootstrap_room, routed_dp_rank, and disagg_prefill_dp_rank to AnthropicMessagesRequest, with the same types as ChatCompletionRequest.
  • Copy them in _convert_to_chat_completion_request. The deprecated data_parallel_rank alias is not added to the new API surface.

Tests

  • test/registered/unit/entrypoints/anthropic/test_serving.py::test_messages_preserves_pd_rendezvous_through_native_conversion fails on main (None != 'prefill.internal') and passes with this change. The file passes (62 tests).

CI States

Latest PR Test (Base): ⏳ Run #36625259014
Latest PR Test (Extra): 🚫 Run #36625258672
Latest PR Test (AMD ROCm 10): 🚫 Run #36625259130

@chromecast56
chromecast56 force-pushed the codex/native-messages-pd-bootstrap branch from 98baf0d to 3283ea2 Compare September 23, 2026 21:57
@hnyls2002

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Sep 29, 2026
@hnyls2002

Copy link
Copy Markdown
Collaborator

/rerun-test test_anthropic_tool_use.py test_openai_server.py::TestOpenAIServer

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test_anthropic_tool_use.py test_openai_server.py::TestOpenAIServer:

🚀 1-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/openai_server/function_call/test_anthropic_tool_use.py

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/openai_server/basic/test_openai_server.py TestOpenAIServer

@hnyls2002
hnyls2002 merged commit 77a8199 into sgl-project:main Sep 29, 2026
86 of 159 checks passed
gilfordting added a commit to gilfordting/sglang that referenced this pull request Oct 14, 2026
AnthropicMessagesRequest already inherits routed_dp_rank from
PDRoutingFields and forwards it to the converted ChatCompletionRequest
(sgl-project#39711, sgl-project#41756). Add the deprecated data_parallel_rank alias with the
shared migration so a body pin on /v1/messages accepts the same fields
as /v1/chat/completions, and cover the conversion in the unit tests.
The header already reached this route through OpenAIServingChat and
keeps precedence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants