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

PR Review: ToolHive API Models Update

Summary

Auto-generated update to Pydantic models from ToolHive's OpenAPI spec. Changes include refactoring, new modules, and OAuth 2.0 enhancements.

✅ Positive Observations

Code Quality

  • Follows native Python types convention (uses list[] not List[])
  • Proper use of Pydantic Field with descriptions
  • Consistent formatting and structure across all generated files

Architecture Improvements

  • Good refactoring: RemoteAuthConfig extracted to separate remote.py module, improving modularity
  • New tokenexchange.py module properly separated for OAuth 2.0 token exchange functionality
  • Import cleanup in runner.py is cleaner with alphabetized imports

🔍 Observations

New Features Added

  1. OAuth 2.0 Resource Indicator (RFC 8707): Added resource field to OAuthConfig, remote.Config, and v1.RemoteOAuthConfig
  2. Token Exchange Support: New tokenexchange.Config with fields for audience-based token exchange
  3. Registry API URL: Added api_url field to v1.UpdateRegistryRequest

Security Considerations

  • client_secret fields remain as plain strings (expected for config models)
  • Token exchange config uses proper OAuth 2.0 patterns
  • No sensitive data exposure issues detected

Potential Concerns

  • header_strategy and subject_token_type in tokenexchange.Config use string types instead of enums - runtime validation needed
  • No breaking changes detected since RemoteAuthConfig wasn't used elsewhere in codebase

📝 Minor Notes

  • All timestamp updates are cosmetic (generation metadata)
  • +115/-43 lines is reasonable for API evolution
  • Auto-generated code quality is good

✅ Recommendation

APPROVE - Clean auto-generated update with proper structure and no issues found.

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