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 17, 2025

PR Review: Update ToolHive API models

🚨 Critical Issue: Breaking Change

The deletion of registry.py breaks existing imports across the codebase.

Files affected:

  • src/mcp_optimizer/toolhive/toolhive_client.py:15
  • src/mcp_optimizer/install.py:6
  • src/mcp_optimizer/ingestion.py:33
  • tests/test_install.py:10 and tests/test_install.py:139,162

All these files import from mcp_optimizer.toolhive.api_models.registry which no longer exists.

Migration path:

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

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

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

📋 Additional Changes

New modules added:

  • tokenexchange.py - Token exchange configuration for OAuth 2.0
  • remote.py - Remote server configuration (replaces RemoteAuthConfig)

Structural changes:

  • runner.py: RemoteAuthConfigremote.Config (line 104)
  • runner.py: Added token_exchange_config field (line 129)
  • types.py: Now contains EnvVar, Header, Metadata, OAuthConfig, RemoteServerMetadata, ImageMetadata, Registry, etc.
  • types.py: Added resource field to OAuthConfig (RFC 8707 support)

✅ Recommendations

  1. Fix breaking changes by updating all imports from registry to types
  2. Run tests to verify no runtime errors
  3. Run linting (task lint, task typecheck) to catch import errors
  4. Consider adding a deprecation path or migration script for future auto-generated updates

This PR cannot be merged as-is - it will break the application at import time.

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