Skip to content

[CI] Fix mypy pre-commit errors on main#36882

Merged
vllm-bot merged 1 commit intomainfrom
fix-mypy-precommit-errors
Mar 12, 2026
Merged

[CI] Fix mypy pre-commit errors on main#36882
vllm-bot merged 1 commit intomainfrom
fix-mypy-precommit-errors

Conversation

@tdoublep
Copy link
Member

@tdoublep tdoublep commented Mar 12, 2026

Summary

  • Fix 3 mypy errors that surface when running pre-commit run -a locally on main
  • 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 imported class as a builtins stub with no __init__ kwargs (matches existing pattern in responses/protocol.py:349-351, added in [BugFix]: Fix local mypy issues #34739)
  • 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)

Test plan

  • pre-commit run -a passes all hooks

🤖 Generated with Claude Code

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>
@tdoublep tdoublep marked this pull request as ready for review March 12, 2026 12:58
@tdoublep tdoublep requested a review from hmellor March 12, 2026 12:58
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 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 hmellor enabled auto-merge (squash) March 12, 2026 13:09
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 12, 2026
Copy link
Contributor

@hickeyma hickeyma left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @tdoublep

# 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]
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to see this sneaking in, it annoyed me too. :)

Copy link
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the work!

@hmellor hmellor mentioned this pull request Mar 12, 2026
@vllm-bot vllm-bot merged commit abcffbb into main Mar 12, 2026
46 of 49 checks passed
@vllm-bot vllm-bot deleted the fix-mypy-precommit-errors branch March 12, 2026 15:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants