Skip to content

Conversation

@wuhang2014
Copy link
Contributor

@wuhang2014 wuhang2014 commented Sep 5, 2025

Purpose

Fix #24199

Test Plan

Test Result


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.

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 enables Python tool tests in the CI, which is a great step forward. The changes involve un-skipping existing tests and adding necessary logic to validate the output of the code interpreter tool. My review focuses on improving the robustness of the new test logic. Specifically, I've identified a potential fragility in how the numerical result is extracted from the model's output string. The suggestions aim to make the tests less likely to fail due to minor variations in the model's response format, ensuring a more reliable CI pipeline.

index = output_string.rfind('9', 0, last_index)
else:
index = -1
assert parse_integer_from_string(
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about assert "977966748" in output_string?
and can you use a harder question that the model can't answer if it doesn't use python tool properly? e.g., multiple 2 very very large numbers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what about assert "977966748" in output_string?

It may not work as expected because output text probably contains comma-seperator and/or markdown format for mathematical expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and can you use a harder question that the model can't answer if it doesn't use python tool properly? e.g., multiple 2 very very large numbers

I will try to calculate the product of two large prime numbers.

Copy link
Contributor Author

@wuhang2014 wuhang2014 Sep 9, 2025

Choose a reason for hiding this comment

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

Add restrictions statement in prompt to simplify output text for easier assertion.

"`var_a=9999999967*9999999769` "
"`var_b=9999999943*9999999781` "
"`var_c=9999999929*9999999787`. "
"Show only the sorted variable names with `<` using ascii."),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure the test will fail without "--tool-server", "demo"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, you are right, the model may guess out the correct answer.

I make a new prompt to let model infer the decimals of a root cube of a big number. And I try it with and without tool server. As expected, it returns correct digits of decimals with tool server while without tool server it returns incorrect numbers and sometimes it may take very long time in reasoning.

@wuhang2014
Copy link
Contributor Author

wuhang2014 commented Sep 10, 2025

Depend on #182

@heheda12345
Copy link
Collaborator

Do you need to install gpt-oss to run this test?

@heheda12345
Copy link
Collaborator

Also CC @yeqcharlotte

@wuhang2014
Copy link
Contributor Author

Do you need to install gpt-oss to run this test?

I think so, it seems like gpt-oss is not listed in any requirments txt file

@@ -13,6 +13,28 @@
logger = init_logger(__name__)


def patch_call_python_script_with_uv():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you do this in unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because python tool is called in a seperate process(namely a RemoteOpenAIServer), I don't think we have a method to patch across processes.

Copy link
Collaborator

@heheda12345 heheda12345 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 your contribution!

@heheda12345 heheda12345 enabled auto-merge (squash) September 12, 2025 04:23
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 12, 2025
@heheda12345 heheda12345 changed the title [Test]Enable python tool tests in CI [gpt-oss] Enable python tool tests in CI Sep 12, 2025
@mergify mergify bot added the gpt-oss Related to GPT-OSS models label Sep 12, 2025
@heheda12345 heheda12345 changed the title [gpt-oss] Enable python tool tests in CI [CI][gpt-oss] Enable python tool tests in CI Sep 12, 2025
@heheda12345 heheda12345 enabled auto-merge (squash) September 12, 2025 04:25
@yeqcharlotte yeqcharlotte moved this from To Triage to In progress in gpt-oss Issues & Enhancements Sep 14, 2025
@heheda12345
Copy link
Collaborator

@wuhang2014 CI failure is related. Can you take a look?

FAILED entrypoints/openai/test_response_api_with_harmony.py::test_code_interpreter[openai/gpt-oss-20b] - AssertionError: assert '5846' in '5847'

@wuhang2014
Copy link
Contributor Author

@wuhang2014 CI failure is related. Can you take a look?

FAILED entrypoints/openai/test_response_api_with_harmony.py::test_code_interpreter[openai/gpt-oss-20b] - AssertionError: assert '5846' in '5847'

Sure, I think gpt-oss is not doing well with empty text returned from python tool. Maybe we can add a hint in text like "Empty result from python tool" instead, and I will try it later.

auto-merge was automatically disabled September 22, 2025 03:04

Head branch was pushed to by a user without write access

Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: wuhang <wuhang6@huawei.com>
@mergify
Copy link

mergify bot commented Oct 5, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @wuhang2014.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Oct 5, 2025
Signed-off-by: wuhang <wuhang6@huawei.com>
@mergify mergify bot removed the needs-rebase label Oct 5, 2025
Copy link
Collaborator

@heheda12345 heheda12345 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you.

@github-project-automation github-project-automation bot moved this from In progress to Ready in gpt-oss Issues & Enhancements Oct 6, 2025
@heheda12345 heheda12345 enabled auto-merge (squash) October 6, 2025 03:47
@heheda12345 heheda12345 merged commit 91ac7f7 into vllm-project:main Oct 6, 2025
85 checks passed
karan pushed a commit to karan/vllm that referenced this pull request Oct 6, 2025
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: Karan Goel <3261985+karan@users.noreply.github.com>
southfreebird pushed a commit to southfreebird/vllm that referenced this pull request Oct 7, 2025
@wuhang2014 wuhang2014 deleted the pythontooltests branch October 9, 2025 06:24
@heheda12345
Copy link
Collaborator

@wangxiyuan sorry for that. It is fixed in #26392

@wangxiyuan
Copy link
Contributor

@heheda12345 thanks for the quick fix. It makes sense.

xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
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
Signed-off-by: wuhang <wuhang6@huawei.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build 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.

[Feature][gpt-oss] Python Tool Test Enhancement

3 participants