Skip to content

fix: complete vLLM tool_choice"auto" compatibility fix#3438

Closed
jilin6627-spec wants to merge 14 commits intoagentscope-ai:mainfrom
jilin6627-spec:fix/vllm-tool-choice-complete-fix
Closed

fix: complete vLLM tool_choice"auto" compatibility fix#3438
jilin6627-spec wants to merge 14 commits intoagentscope-ai:mainfrom
jilin6627-spec:fix/vllm-tool-choice-complete-fix

Conversation

@jilin6627-spec
Copy link
Copy Markdown
Contributor

fix: complete vLLM tool_choice="auto" compatibility fix

Problem

vLLM OpenAI-compatible server returns 400 error when receiving tool_choice="auto", unless the server was started with --enable-auto-tool-choice --tool-call-parser <...>.

Original PR only fixed TokenRecordingModelWrapper, but there are three more code paths that still pass through tool_choice="auto" to the model client:

  1. QwenPawReactAgent._reasoning() in src/qwenpaw/agents/react_agent.py
  2. ToolGuardMixin._reasoning() in src/qwenpaw/agents/tool_guard_mixin.py
  3. RoutingChatModel.__call__() in src/qwenpaw/agents/routing_chat_model.py

This causes the 400 error even with the original fix applied, because tool_choice="auto" still reaches the vLLM server through these other paths.

Solution

Apply the same fix to all three paths: when tool_choice == "auto", set it to None before passing to the underlying model client. This matches what was already done in TokenRecordingModelWrapper.

Testing

  • Tested by building arm64 docker image and running QwenPaw connected to a standard vLLM server without --enable-auto-tool-choice
  • Before this fix: 400 error on first query
  • After this fix: query works normally, no 400 error

@github-actions
Copy link
Copy Markdown

Welcome to QwenPaw! 🐾

Hi @jilin6627-spec, this is your 2nd Pull Request.

📋 About PR Template

To help maintainers review your PR faster, please make sure to include:

  • Description - What this PR does and why
  • Type of Change - Bug fix / Feature / Breaking change / Documentation / Refactoring
  • Component(s) Affected - Core / Console / Channels / Skills / CLI / Documentation / Tests / CI/CD / Scripts
  • Checklist:
    • Run and pass pre-commit run --all-files
    • Run and pass relevant tests (pytest or as applicable)
    • Update documentation if needed
  • Testing - How to test these changes
  • Local Verification Evidence:
    pre-commit run --all-files
    # paste summary result
    
    pytest
    # paste summary result

Complete PR information helps speed up the review process. You can edit the PR description to add these details.

🙌 Join Developer Community

Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:
https://qwenpaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.


Tip

⭐ If you find QwenPaw useful, please give us a Star!

Star QwenPaw

Staying ahead

Star QwenPaw on GitHub and be instantly notified of new releases.

Your star helps more developers discover this project! 🐾

@xieyxclack
Copy link
Copy Markdown
Member

Fixed in #3295 ?

@xieyxclack
Copy link
Copy Markdown
Member

Closed as invalid

@xieyxclack xieyxclack closed this Apr 16, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in QwenPaw Apr 16, 2026
@jilin6627-spec
Copy link
Copy Markdown
Contributor Author

jilin6627-spec commented Apr 16, 2026 via email

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants