Skip to content

Conversation

@alecsolder
Copy link
Contributor

@alecsolder alecsolder commented Sep 23, 2025

Purpose

Fix a bug related to container tool reasoning output. Occasionally it will output container tool to commentary channel.

Test Plan

Ran serving with container tool enabled.

Test Result

No longer crashes when creating output reasoning messages for container tool.

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 addresses a bug where reasoning output for the container tool could cause a crash if sent to the 'commentary' channel. The fix correctly handles this case, aligning its behavior with other tools like 'python' and 'browser'. My review includes a suggestion to refactor the conditional logic for improved readability and maintainability.

Comment on lines 319 to +321
elif recipient is not None and (recipient.startswith("python")
or recipient.startswith("browser")):
or recipient.startswith("browser")
or recipient.startswith("container")):
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The conditional logic is becoming a bit long with the addition of the 'container' tool. To improve readability and maintainability, you can leverage the fact that str.startswith() accepts a tuple of prefixes. This makes the code more concise and easier to update in the future.

        elif recipient is not None and recipient.startswith(("python", "browser", "container")):

Copy link
Collaborator

Choose a reason for hiding this comment

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

probably need a better way to check this lol any better idea?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wow, just notice that str.startswith supports passing in a tuple of prefixes. TIL.

Copy link
Contributor

@qandrew qandrew left a comment

Choose a reason for hiding this comment

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

could you provide repro instructions in the description, like what prompts caused this?

Comment on lines 319 to +321
elif recipient is not None and (recipient.startswith("python")
or recipient.startswith("browser")):
or recipient.startswith("browser")
or recipient.startswith("container")):
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably need a better way to check this lol any better idea?

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Sep 23, 2025
@yeqcharlotte yeqcharlotte enabled auto-merge (squash) September 23, 2025 17:30
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 23, 2025
Comment on lines 319 to +321
elif recipient is not None and (recipient.startswith("python")
or recipient.startswith("browser")):
or recipient.startswith("browser")
or recipient.startswith("container")):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Non-blocking: I saw "python", "browser", "container" are flooded around the code, could we predefine it as a variable / named literal or enum to avoid typo?

output_items.append(response_item)
elif recipient is not None and (recipient.startswith("python")
or recipient.startswith("browser")):
or recipient.startswith("browser")
Copy link
Collaborator

Choose a reason for hiding this comment

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

non-blocking: The function is getting quite complicated, can we add unit test to protect the behavior?

@alecsolder
Copy link
Contributor Author

For @yeqcharlotte @Jialin , I completely agree that the logic is getting scary with the different conditions based on the tool names. This code path is also not correct in the first place because messages here are returned as reasoning messages, but are actually tool calls.

So basically this whole flow needs a refactor, I think that is best done once we begin adding support for doing server side execution of "function tools" in general. The main challenge here is that there needs to be model specific model to handle certain tools in a special way, which we don't have built out, but definitely shouldn't be part of this PR.

Comment on lines 319 to +321
elif recipient is not None and (recipient.startswith("python")
or recipient.startswith("browser")):
or recipient.startswith("browser")
or recipient.startswith("container")):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wow, just notice that str.startswith supports passing in a tuple of prefixes. TIL.

@yeqcharlotte yeqcharlotte merged commit c828d1b into vllm-project:main Sep 23, 2025
56 checks passed
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Alec Solder <[email protected]>
Co-authored-by: Alec Solder <[email protected]>
Signed-off-by: yewentao256 <[email protected]>
gjc0824 pushed a commit to gjc0824/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Alec Solder <[email protected]>
Co-authored-by: Alec Solder <[email protected]>
Signed-off-by: gaojc <[email protected]>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Alec Solder <[email protected]>
Co-authored-by: Alec Solder <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Alec Solder <[email protected]>
Co-authored-by: Alec Solder <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 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.

4 participants