Skip to content

fix(router): unify route_request to async with optional request_json#929

Open
nejch wants to merge 2 commits intovllm-project:mainfrom
nejch:fix/proxy-multipart-session-router
Open

fix(router): unify route_request to async with optional request_json#929
nejch wants to merge 2 commits intovllm-project:mainfrom
nejch:fix/proxy-multipart-session-router

Conversation

@nejch
Copy link
Copy Markdown
Contributor

@nejch nejch commented Apr 23, 2026

proxy_multipart_request calls router.route_request without the request_json argument, which causes a TypeError when the router is a SessionRouter since those require request_json as a positional parameter. This was introduced by f1265a0 which added request_json as a required parameter to SessionRouter.route_request but didn't update proxy_multipart_request.

The affects /v1/audio/transcriptions and /v1/images/edits endpoints when using session-based routers.

This PR makes request_json an optional parameter and makes all routers' route_request async.


  • Make sure the code changes pass the pre-commit checks.
  • Sign-off your commit by using -s when doing git commit
  • Try to classify PRs for easy understanding of the type of changes, such as [Bugfix], [Feat], and [CI].
Detailed Checklist (Click to Expand)

Thank you for your contribution to production-stack! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.

PR Title and Classification

Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:

  • [Bugfix] for bug fixes.
  • [CI/Build] for build or continuous integration improvements.
  • [Doc] for documentation fixes and improvements.
  • [Feat] for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).
  • [Router] for changes to the vllm_router (e.g., routing algorithm, router observability, etc.).
  • [Misc] for PRs that do not fit the above categories. Please use this sparingly.

Note: If the PR spans more than one category, please include all relevant prefixes.

Code Quality

The PR need to meet the following code quality standards:

  • Pass all linter checks. Please use pre-commit to format your code. See README.md for installation.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Please include sufficient tests to ensure the change is stay correct and robust. This includes both unit tests and integration tests.

DCO and Signed-off-by

When contributing changes to this project, you must agree to the DCO. Commits must include a Signed-off-by: header which certifies agreement with the terms of the DCO.

Using -s with git commit will automatically add this header.

What to Expect for the Reviews

We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of YuhanLiu11
, Shaoting-Feng or ApostaC.

Copy link
Copy Markdown
Contributor

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

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 routing_logic.py to handle request_json as an optional parameter in the RoutingInterface and RoundRobinRouter implementations, while also improving null safety in extract_session_id. However, the review highlights that the changes are incomplete as several other router subclasses still require request_json as a mandatory argument, which will cause TypeError during execution. Furthermore, there is a potential issue where synchronous calls to asynchronous router methods will return coroutines instead of the expected URL strings.

Comment thread src/vllm_router/routers/routing_logic.py
Signed-off-by: Nejc Habjan <nejc.habjan@siemens.com>
@nejch nejch force-pushed the fix/proxy-multipart-session-router branch from ff4c3f2 to 4b09be8 Compare April 23, 2026 06:50
@nejch nejch changed the title fix(router): make request_json optional in route_request interface fix(router): unify route_request to async with optional request_json Apr 23, 2026
@ruizhang0101
Copy link
Copy Markdown
Collaborator

@nejch Hi, Could you fix the CI issue when you have time?

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