Repository navigation
fix(sglang): return sidecar request refusals to the client - #15285
Conversation
Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: ai-dynamo/dynamo/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughSGLang request-conversion and validation errors now use a shared ChangesSGLang request errors
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The SGLang request-error change appears mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Overview:
The SGLang sidecar refuses some requests before it calls the engine, for example an image request or
n=2. The client then gets400 {"message":"Invalid request"}, and the real reason is only in the worker log. Since #14396, the HTTP body showsDynamoError::public_message()and falls back to "Invalid request" when the error has no public message. The sidecar sets only the private message. This PR gives the fixed request-validation texts of the sidecar gRPC request builder a public message.Repro (stock SGLang, one SGLang sidecar worker):
Before:
{"message":"Invalid request","type":"Bad Request","code":400}After:
{"message":"multimodal payloads are not supported by SGLang's native Generate RPC","type":"Bad Request","code":400}The same change applies to
n=2("n must be 1 for the SGLang sidecar") and to the other request checks.Details:
lib/sidecar/sglang/src/client.rsaddsinvalid_request(&'static str). The helper sets the same fixed text as the message and as the public message. The parameter type is&'static str, so client input and runtime values cannot become public through this helper.lib/sidecar/sglang/src/protocol.rsuses the helper for its fixed request-validation texts. These are the checks invalidate_requestand the range checks formax_tokens,min_tokens,logprobs, the data-parallel rank, token ids, and stop-token ids. The token-id texts no longer include the client value. Errors that carry endpoints, bootstrap ports and rooms, engine state, or engine text stay private.The
prompt_embedscheck now runs before the empty-token check. Aprompt_embedsrequest arrives with emptytoken_ids, so the old order gave the wrong reason. The thinking-budget text now names the client fieldthinking_token_budget. This PR does not add or remove a refusal.The tests check the public text for three refusals. They also check that a disaggregation handoff error has no public message.
Out of scope: the vLLM and TRT-LLM sidecars have the same gap through
invalid_argumentinlib/sidecar/common/src/error.rs. The refusals on the native HTTP path of the SGLang sidecar (native_http.rs) also keep a private message.Related Issues
🤖 Generated with Claude Code
Summary by CodeRabbit