Skip to content

fix: resolve typecheck and linting issues#775

Open
claude[bot] wants to merge 1 commit intomainfrom
assistant/improve-20260316-034223
Open

fix: resolve typecheck and linting issues#775
claude[bot] wants to merge 1 commit intomainfrom
assistant/improve-20260316-034223

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 16, 2026

Summary

Fixed type error and linting issues to improve code quality:

  1. Type Error Fix: Fixed incorrect type literal in provider_handler.py

    • Changed "image" to "image_url" to match MessageImageContent type definition
    • Aligns wire format with OpenAI API standard for image content in messages
  2. Linting Fixes:

    • Removed trailing whitespace in huggingface_provider.py
    • Fixed import order in worker/__main__.py
    • Fixed import order in scripts/export_parity_snapshot.py
    • Removed unnecessary mode arguments in patch files

Test plan

  • make typecheck passes
  • make lint passes (minor I001 warnings remain in other files)
  • All worker tests pass (pytest tests/worker/ -v)
  • Verify type error resolved

Files changed

  • src/nodetool/worker/provider_handler.py - Fixed type literal
  • src/nodetool/providers/huggingface_provider.py - Fixed whitespace
  • src/nodetool/worker/__main__.py - Fixed import order
  • scripts/export_parity_snapshot.py - Fixed import order
  • patch_file.py, patch_tests.py - Removed unnecessary mode args

🤖 Generated with Claude Code

- Fix type error in provider_handler.py: Change 'image' to 'image_url' to match MessageImageContent type
- Remove trailing whitespace in huggingface_provider.py
- Fix import order in worker/__main__.py
- Fix import order in scripts/export_parity_snapshot.py
- Remove unnecessary mode arguments in patch files

The main fix addresses a type error where the wire format used 'type="image"' but the
MessageImageContent class expects 'type="image_url"'. This aligns with the OpenAI
API format for image content in messages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants