From ddc1df1203036c97ef2398ef4e2d012301c4c17f Mon Sep 17 00:00:00 2001 From: ishandhanani <82981111+ishandhanani@users.noreply.github.com> Date: Sun, 13 Sep 2026 12:27:59 -0700 Subject: [PATCH] fix(router): simplify bucket context limit check (#39259) Signed-off-by: Ishan Dhanani --- experimental/sgl-router/src/policies/buckets.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/sgl-router/src/policies/buckets.rs b/experimental/sgl-router/src/policies/buckets.rs index 7ed9443c4..e04a333a3 100644 --- a/experimental/sgl-router/src/policies/buckets.rs +++ b/experimental/sgl-router/src/policies/buckets.rs @@ -164,9 +164,9 @@ impl BucketSelector { }) else { return Some(candidate); }; - if !spec + if spec .max_context_tokens - .is_none_or(|max_context| request.input_tokens <= max_context) + .is_some_and(|max_context| request.input_tokens > max_context) || (config.ttft_slo_policy == SloBucketPolicy::SloFirst && !ttft_eligible(spec, request.ttft_slo_ms)) {