[CI] Fix mypy pre-commit errors on main#36882
Merged
Conversation
Fix 3 mypy errors that surface when running pre-commit hooks locally: 1. abstract_tool_parser.py: Add type: ignore[call-arg] for StructuredOutputsParams(json=...) - this is a known limitation of --follow-imports skip where mypy resolves the class as a builtins stub with no __init__ kwargs. Matches existing pattern in responses/protocol.py:349. 2. kimi_audio.py: Widen parameter types from list[int] to Sequence[int] for decode() and convert_ids_to_tokens() to satisfy the TokenizerLike protocol (Liskov substitution principle). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request resolves three mypy errors. In vllm/tokenizers/kimi_audio.py, parameter types are correctly widened from list[int] to Sequence[int] to conform to the TokenizerLike protocol. In vllm/tool_parsers/abstract_tool_parser.py, a type: ignore[call-arg] is added to work around a known mypy limitation, a practice consistent with other parts of the codebase. The changes are accurate and effectively fix the type-checking issues.
hmellor
approved these changes
Mar 12, 2026
hickeyma
approved these changes
Mar 12, 2026
hickeyma
reviewed
Mar 12, 2026
| # structured output json settings to make tool calling work correctly | ||
| request.structured_outputs = StructuredOutputsParams( | ||
| json=json_schema_from_tool | ||
| json=json_schema_from_tool # type: ignore[call-arg] |
Contributor
There was a problem hiding this comment.
Good to see this sneaking in, it annoyed me too. :)
yewentao256
approved these changes
Mar 12, 2026
Member
yewentao256
left a comment
There was a problem hiding this comment.
LGTM, thanks for the work!
Closed
DarkLight1337
approved these changes
Mar 12, 2026
athrael-soju
pushed a commit
to athrael-soju/vllm
that referenced
this pull request
Mar 16, 2026
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Athrael Soju <athrael.soju@gmail.com>
Lucaskabela
pushed a commit
to Lucaskabela/vllm
that referenced
this pull request
Mar 17, 2026
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
wendyliu235
pushed a commit
to wendyliu235/vllm-public
that referenced
this pull request
Mar 18, 2026
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
fxdawnn
pushed a commit
to fxdawnn/vllm
that referenced
this pull request
Mar 19, 2026
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pre-commit run -alocally on mainabstract_tool_parser.py: Addtype: ignore[call-arg]forStructuredOutputsParams(json=...)— this is a known limitation of--follow-imports skipwhere mypy resolves the imported class as a builtins stub with no__init__kwargs (matches existing pattern inresponses/protocol.py:349-351, added in [BugFix]: Fix local mypy issues #34739)kimi_audio.py: Widen parameter types fromlist[int]toSequence[int]fordecode()andconvert_ids_to_tokens()to satisfy theTokenizerLikeprotocol (Liskov substitution principle)Test plan
pre-commit run -apasses all hooks🤖 Generated with Claude Code