Skip to content

[router] support manual policy (sticky + min_load) and set as default agentic routing policy#1690

Open
yueming-yuan wants to merge 2 commits into
mainfrom
yueming/router-manual-policy
Open

[router] support manual policy (sticky + min_load) and set as default agentic routing policy#1690
yueming-yuan wants to merge 2 commits into
mainfrom
yueming/router-manual-policy

Conversation

@yueming-yuan

@yueming-yuan yueming-yuan commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

before:
img_v3_0213l_9d9da8cb-6850-4062-9a63-c1b4aab98eix
after:
img_v3_0213l_2b9d1270-5bbc-4d6d-8ba7-6bb400928fix

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the routing logic in 'miles/rollout/sglang_rollout.py' to support the 'manual' router policy in addition to 'consistent_hashing' when using session IDs. The feedback suggests updating the outdated inline comments on lines 195 and 316 to accurately reflect this new behavior and avoid confusion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

# Use session_id for consistent hashing routing if router uses consistent_hashing policy
headers = None
if args.sglang_router_policy == "consistent_hashing" and sample.session_id:
if args.sglang_router_policy in ("consistent_hashing", "manual") and sample.session_id:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 195 still specifically mentions the consistent_hashing policy. Since support for the manual policy has been added, please update the comment to reflect this change (e.g., by generalizing it to session-based routing).


# Generate a unique session_id for each sample in the group (consistent hashing only)
if args.sglang_router_policy == "consistent_hashing":
if args.sglang_router_policy in ("consistent_hashing", "manual"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 316 still states (consistent hashing only). Since the manual policy is now also supported, please update this comment to prevent misleading future readers.

@yueming-yuan yueming-yuan force-pushed the yueming/router-manual-policy branch from 8f45ecb to bb5e2b3 Compare July 15, 2026 23:21
@yueming-yuan yueming-yuan changed the title Support router 'manual' policy: fix load-accumulation instability of consistent_hashing under fully-async concurrency [router] support manual policy (sticky + min_load) and set as default agentic routing policy Jul 15, 2026
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.

1 participant