-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
[gpt-oss] Small bug fixes for frontend #22512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this 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 introduces several bug fixes for the gpt-oss response API and adds support for Triton kernels for MoE layers with mxfp4 quantization. The changes are extensive, touching API serving logic, context management, and model execution layers. My review focuses on the correctness and robustness of these changes. I've identified a critical issue in the streaming response generation logic where item and content indices are not being updated, and a high-severity issue in tool call argument parsing that could lead to unhandled exceptions.
current_content_index = 0 # FIXME: this number is never changed | ||
current_output_index = 0 | ||
current_item_id = "" # FIXME: this number is never changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variables current_content_index
and current_item_id
are initialized to static values and are never updated within the responses_stream_generator
loop, as indicated by the FIXME
comments. This is a critical issue as it will result in all streamed output items having an empty or incorrect ID and a content index of 0, which violates the API contract and will likely cause issues for clients. These variables should be updated with appropriate values for each new output item, likely when ctx.is_expecting_start()
is true.
vllm/entrypoints/harmony_utils.py
Outdated
action = ActionFind(pattern=browser_call["pattern"], | ||
url=f"cursor:{browser_call.get('url', '')}", | ||
type="find") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direct access browser_call["pattern"]
will raise a KeyError
if the pattern
key is missing from the browser_call
dictionary, which can occur if the model output is malformed. This would cause an unhandled exception and crash the request. It's safer to use the .get()
method and handle the case where the key is missing, similar to how query
and url
are handled in the surrounding code.
pattern = browser_call.get("pattern")
if pattern is None:
raise ValueError("Missing 'pattern' in browser.find call")
action = ActionFind(pattern=pattern,
url=f"cursor:{browser_call.get('url', '')}",
type="find")
Signed-off-by: Chen Zhang <[email protected]>
Signed-off-by: Chen Zhang <[email protected]>
Signed-off-by: Chen Zhang <[email protected]>
855cff8
to
4c58ba0
Compare
Signed-off-by: Chen Zhang <[email protected]>
Signed-off-by: Chen Zhang <[email protected]>
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Fix several bugs for gpt-oss response API
Test Plan
triton: 3.4.0+git663e04e8 torch: 2.9.0.dev20250723+cu128, h100
EXA_API_KEY=**** VLLM_ENABLE_RESPONSES_API_STORE=1 pytest -vs test_response_api_with_harmony.py
"--tool-server", "demo"
to"--tool-server", "localhost:port1,localhost:port2"
(where port1 and port2 are MCP clients for builtin tools)Test Result
test_streaming
fails as expected (because streaming + MCP + tool call is not supported yet)(Optional) Documentation Update
NOTES
Should be merged after #22431 and #22421
needs triton: 3.4.0+git663e04e8 and torch: 2.9.0.dev20250723+cu128