Skip to content

Conversation

@Jialin
Copy link
Collaborator

@Jialin Jialin commented Oct 13, 2025

Purpose

Address leftover comments in #26620

  • hasattr checks
  • unit test location

Test Plan & Test Result

With the change, unit tests are still finished successfully

> pytest tests/entrypoints/openai/test_protocol.py 
> pytest tests/entrypoints/openai/test_response_api_with_harmony.py -k test_streaming
Screenshot 2025-10-13 at 12 17 09 PM Screenshot 2025-10-13 at 12 16 55 PM
Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@Jialin
Copy link
Collaborator Author

Jialin commented Oct 13, 2025

CC @qandrew @yeqcharlotte

Copy link
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 refactors the unit tests for message serialization and improves the serialization logic. The movement of tests into a dedicated file test_protocol.py is a good change for code organization. The update in serialize_message to check for hasattr(msg, "to_dict") is more explicit and robust than checking for __dict__.

However, I've found a critical issue in the serialize_message function where it can return inconsistent types (a dict or a str), which will lead to incorrect JSON serialization for certain messages. I've left a detailed comment with a recommended fix. Addressing this is crucial for the correctness of the Response API.

Copy link
Collaborator

@yeqcharlotte yeqcharlotte left a comment

Choose a reason for hiding this comment

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

thanks for the change!

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Oct 13, 2025
@yeqcharlotte yeqcharlotte enabled auto-merge (squash) October 13, 2025 21:37
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 13, 2025
@yeqcharlotte yeqcharlotte merged commit 35bc22f into vllm-project:main Oct 13, 2025
52 of 53 checks passed
@Jialin Jialin deleted the response-api branch October 14, 2025 07:33
1994 pushed a commit to 1994/vllm that referenced this pull request Oct 14, 2025
Dhruvilbhatt pushed a commit to Dhruvilbhatt/vllm that referenced this pull request Oct 14, 2025
bbartels pushed a commit to bbartels/vllm that referenced this pull request Oct 16, 2025
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
Zhathw pushed a commit to Zhathw/vllm that referenced this pull request Nov 12, 2025
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend gpt-oss Related to GPT-OSS models ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants