Skip to content

chore: Update ToolHive API models#320

Open
stackloke2e wants to merge 1 commit intomainfrom
update-thv-models-21653662556
Open

chore: Update ToolHive API models#320
stackloke2e wants to merge 1 commit intomainfrom
update-thv-models-21653662556

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 Feb 4, 2026

PR Review: ToolHive API Models Update

Summary

Auto-generated update to Pydantic models from ToolHive OpenAPI spec. Changes include new auth server models, OAuth caching fields, and header forwarding config.

⚠️ Breaking Change Detected

Removed field: virtual_mcp from core.Workload (core.py:61-65)

This field is actively used in the codebase:

  • src/mcp_optimizer/toolhive/k8s_client.py:219 - assigns virtual_mcp from API response
  • src/mcp_optimizer/ingestion.py:373,418,738,757,825 - multiple usages for processing
  • src/mcp_optimizer/db/ - database models and operations rely on this field

Impact: This will break workload ingestion and virtualization logic. The k8s_client will try to access a non-existent field.

Recommendation:

  1. Verify if ToolHive truly removed this field or if codegen config needs adjustment
  2. If removed upstream, add migration logic to handle the field absence gracefully
  3. Update all usage sites to handle None/missing field

Code Quality ✅

  • Generated code follows project conventions (native types, proper Field descriptions)
  • Proper imports and structure maintained
  • Timestamp headers correctly updated

New Features

  • authserver.py: New embedded auth server config (171 lines)
  • remote.py: OAuth token caching for session persistence
  • runner.py: Header forwarding from secrets or plaintext
  • v1.py: API endpoint changes for header forwarding

Security Note ⚠️

New plaintext header config warns about storing sensitive data - good documentation present in descriptions.

Performance

No concerns - these are data models only.

Recommendation

Do not merge until virtual_mcp removal is addressed. This will cause runtime errors in workload processing.

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.

2 participants