Skip to content

Conversation

@stackloke2e
Copy link
Contributor

Summary

This PR updates the ToolHive API models generated from the latest OpenAPI specification.

Changes

  • Updated Pydantic models in src/mcp_optimizer/toolhive/api_models/

Notes

  • This PR was automatically generated by the update-thv-models workflow
  • The models are generated using datamodel-codegen from ToolHive's OpenAPI endpoint

🤖 Generated with GitHub Actions

Automated update of ToolHive API models from OpenAPI specification.
@claude
Copy link

claude bot commented Jan 8, 2026

PR Review

Summary

Auto-generated update of ToolHive API models from OpenAPI spec. The changes are primarily modernizing Python type hints from Optional[T] to T | None and from typing imports to native Python 3.10+ union types.

✅ Positives

  • Modern type hints: Correctly uses native Python union types (str | None) instead of Optional from typing module
  • Consistent changes: All 17 files updated uniformly following the same pattern
  • New field added: scopes field added to TokenValidatorConfig in auth.py:59-62 for OAuth scope handling (RFC 9728)
  • Removed deprecated field: tool_type removed from Workload model in core.py (was always "mcp")
  • Auto-generated: Uses datamodel-codegen, reducing manual errors

🔍 Observations

  1. Breaking change: Removed tool_type field from Workload model (core.py). Any code depending on this field will break
  2. Type modernization: All type hints now use PEP 604 union syntax (X | None), requiring Python 3.10+
  3. Timestamp update: Generation timestamp changed from 2025-12-02 to 2026-01-08

⚠️ Recommendations

  1. Version check: Ensure pyproject.toml requires Python 3.10+ (needed for X | None syntax)
  2. Breaking change: Document the removal of tool_type field in release notes if this is user-facing
  3. Consistency: Consider updating /src/mcp_optimizer/config.py which still uses from typing import Optional for consistency

🎯 Verdict

LGTM with minor note - Clean auto-generated update. Main concern is the breaking change with tool_type removal - verify this does not impact existing usage.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants