Skip to content

Conversation

@kennyu
Copy link

@kennyu kennyu commented Dec 1, 2025

Purpose

Fixes #29763
Add as_list() wrapper to output.token_ids in two code paths that were missing it:

  • Line 1034: tool_choice_auto only path
  • Line 1048: reasoning only path

This fixes GLM-4.5 reasoning parser streaming when no tools are included in the request. The token_ids field is a GenericSequence which may not be a list, causing issues with the in operator in parser methods.

Add as_list() wrapper to output.token_ids in two code paths that were
missing it:
- Line 1034: tool_choice_auto only path
- Line 1048: reasoning only path

This fixes GLM-4.5 reasoning parser streaming when no tools are included
in the request. The token_ids field is a GenericSequence which may not
be a list, causing issues with the `in` operator in parser methods.

Fixes vllm-project#29763
@mergify mergify bot added the frontend label Dec 1, 2025
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

👋 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 fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

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 ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@njhill
Copy link
Member

njhill commented Dec 1, 2025

@kennyu these abstract methods in the ReasoningParser interface declare the args as Sequence[int] so I'm not sure this is the "correct" fix. If a particular implementation requires it to be a list then better to add the as_list() within that impl.

However, Sequence should be sufficient to use the in operator, so are you sure this is actually needed? Could you elaborate on the specific error encountered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GLM-4.5 reasoning parser streaming fails without tools in request - missing as_list() conversion

2 participants