Skip to content

The agent that grows with you

fix(solstice): load the transport on first use, not at discovery (#134233)

ethernet51609d827bb7
diff --git a/plugins/model-providers/solstice/__init__.py b/plugins/model-providers/solstice/__init__.py
index f603c21fa37..5ea1e954346 100644
--- a/plugins/model-providers/solstice/__init__.py
+++ b/plugins/model-providers/solstice/__init__.py
@@ -16,7 +16,10 @@ from providers import register_provider
from providers.base import ProviderProfile
from .auth import broker_token_request, discover_client
-from .transport import INFERENCE_BASE_URL, SolsticeClient
+
+# Lives here, not in transport.py: discovery imports this module from interpreters without the app's
+# HTTP stack (PM's runtime reads config, which lists providers), so the transport loads on first use.
+INFERENCE_BASE_URL = "https://generativelanguage.googleapis.com/v1alpha"
# Verified on the per-user-quota endpoint, which has no model listing a user token may read (its
# /models answers 403 ACCESS_TOKEN_SCOPE_INSUFFICIENT). Quota is per model, so lite stays last as the
@@ -43,6 +46,8 @@ def _auth_handler(action: str, args: Any) -> bool:
class SolsticeProfile(ProviderProfile):
def create_client(self, **client_kwargs: Any) -> Any:
+ from .transport import SolsticeClient
+
allowed = {"api_key", "base_url", "default_headers", "timeout", "http_client"}
return SolsticeClient(**{k: v for k, v in client_kwargs.items() if k in allowed})
diff --git a/plugins/model-providers/solstice/transport.py b/plugins/model-providers/solstice/transport.py
index b8c714c0e96..6efadc7c40d 100644
--- a/plugins/model-providers/solstice/transport.py
+++ b/plugins/model-providers/solstice/transport.py
@@ -11,7 +11,7 @@ from typing import Any, Dict
from agent.gemini_native_adapter import GeminiAPIError, GeminiNativeClient, gemini_http_error
-INFERENCE_BASE_URL = "https://generativelanguage.googleapis.com/v1alpha"
+from . import INFERENCE_BASE_URL
class SolsticeClient(GeminiNativeClient):