feat: add refresh_models support to inference adapters (default: false)

inference adapters can now configure `refresh_models: bool` to control periodic model listing from their providers

BREAKING CHANGE: together inference adapter default changed. previously always refreshed, now follows config.
This commit is contained in:
Matthew Farrellee 2025-10-07 07:23:07 -04:00
parent 509ac4a659
commit bc47900ec0
31 changed files with 33 additions and 67 deletions

View file

@ -466,10 +466,16 @@ class TestOpenAIMixinModelRegistration:
assert result is None
async def test_should_refresh_models(self, mixin):
"""Test should_refresh_models method (should always return False)"""
"""Test should_refresh_models method returns config value"""
# Default config has refresh_models=False
result = await mixin.should_refresh_models()
assert result is False
config_with_refresh = RemoteInferenceProviderConfig(refresh_models=True)
mixin_with_refresh = OpenAIMixinImpl(config=config_with_refresh)
result_with_refresh = await mixin_with_refresh.should_refresh_models()
assert result_with_refresh is True
async def test_register_model_error_propagation(self, mixin, mock_client_with_exception, mock_client_context):
"""Test that errors from provider API are properly propagated during registration"""
model = Model(