diff --git a/strix/config/models.py b/strix/config/models.py index f308b542..c2860da8 100644 --- a/strix/config/models.py +++ b/strix/config/models.py @@ -71,9 +71,15 @@ def configure_sdk_model_defaults(settings: Settings) -> None: set_tracing_disabled(True) except ImportError as exc: # Disabling tracing eagerly initializes an httpx client that may need an - # optional transport (e.g. socksio for SOCKS proxies). Tracing is already - # being turned off, so a failure here is non-fatal — log and continue. - logger.warning("Could not disable SDK tracing: %s", exc) + # optional transport (e.g. socksio for SOCKS proxies). A failure here is + # non-fatal for startup, but tracing then stays at the SDK default + # (enabled), so make the consequence explicit rather than silent. + logger.warning( + "Could not disable SDK tracing (%s); tracing may remain enabled and " + "spans could be sent to the provider. Install the missing transport " + "(e.g. 'socksio') to resolve.", + exc, + ) _configure_litellm_compatibility() if llm.api_key: set_default_openai_key(llm.api_key, use_for_tracing=False) diff --git a/tests/test_model_config.py b/tests/test_model_config.py index 3d82437b..e5693f64 100644 --- a/tests/test_model_config.py +++ b/tests/test_model_config.py @@ -38,6 +38,9 @@ def test_configure_tolerates_tracing_import_error(monkeypatch: pytest.MonkeyPatc monkeypatch.setattr(models, "set_tracing_disabled", _raise) monkeypatch.setattr(models, "_configure_litellm_compatibility", lambda: None) + # With api_base=None the function reaches the real set_default_openai_api; + # stub it so the test stays isolated from SDK-side effects. + monkeypatch.setattr(models, "set_default_openai_api", lambda _mode: None) # Should not raise despite set_tracing_disabled blowing up. models.configure_sdk_model_defaults(_make_settings())