Skip to content

Conversation

@stackloke2e
Copy link

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 Nov 14, 2025

PR Review: ToolHive API Models Update

❌ Critical Issue - Breaking Changes

BLOCKER: This PR introduces breaking changes that will cause import errors in existing code.

Problem

The registry.py module has been deleted, but it is still imported in 3 files:

  • src/mcp_optimizer/toolhive/toolhive_client.py:15
  • src/mcp_optimizer/install.py:6
  • src/mcp_optimizer/ingestion.py:33

These files import ImageMetadata, Registry, and RemoteServerMetadata from registry.py.

Solution Required

The models have been moved to types.py. Update all imports:

# Old (broken):
from mcp_optimizer.toolhive.api_models.registry import ImageMetadata, Registry, RemoteServerMetadata

# New (correct):
from mcp_optimizer.toolhive.api_models.types import ImageMetadata, Registry, RemoteServerMetadata

✅ Positive Changes

  • New remote.py module properly extracts remote config (formerly RemoteAuthConfig)
  • New tokenexchange.py module adds OAuth token exchange support
  • runner.py correctly imports new modules
  • types.py consolidates models from deleted registry.py
  • OAuth resource field added (RFC 8707)

Recommendations

  1. Fix imports in the 3 affected files before merging
  2. Run task typecheck to verify no type errors
  3. Run task test to ensure all tests pass

Code Quality: ⭐⭐⭐⭐

Generated code looks clean and well-structured, but the breaking changes must be addressed.

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