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

PR Review: Update ToolHive API Models

This PR updates auto-generated Pydantic models from the latest ToolHive OpenAPI specification. Overall, the changes look good with proper code organization improvements.

✅ Positive Changes

Better Code Organization

  • Refactored registry.py (274 lines) into smaller, focused modules:
    • remote.py (39 lines) - Remote auth configuration
    • tokenexchange.py (40 lines) - OAuth token exchange config
    • types.py (+268 lines) - Shared types consolidation
  • This improves modularity and maintainability

Proper Dependency Management

  • New imports properly added to runner.py:11-21 for the refactored modules
  • Field references correctly updated (registry.EnvVartypes.EnvVar, registry.Headertypes.Header)

New Features Added

  • remote.Config.resource (line 32-34) - OAuth 2.0 resource indicator (RFC 8707)
  • types.OAuthConfig.resource (line 107-108) - Same OAuth feature in types
  • runner.RunConfig.token_exchange_config (line 129) - Token exchange support

⚠️ Potential Issues

No Breaking Changes Detected

  • All existing references to registry models appear compatible
  • Code in toolhive_client.py, ingestion.py uses registry objects properly
  • Models maintain backward compatibility

📋 Recommendations

  1. Consider running validation: Since these are auto-generated models, verify they work with actual ToolHive API responses
  2. Check for unused imports: With registry.py deleted, ensure no stale imports remain in other files
  3. Test OAuth flows: New resource field and token exchange config should be tested with OAuth providers

Security Note

✅ No security concerns - these are data models with proper type validation via Pydantic

Summary

This is a clean refactoring of auto-generated code. The module split improves maintainability without introducing breaking changes. Approved for merge after validation testing.

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