From b8908048b330cb755c203ae0049afcd0616bdc91 Mon Sep 17 00:00:00 2001 From: Namrata Ghadi Date: Fri, 20 Nov 2026 23:46:57 +0530 Subject: [PATCH] Revert "feat(evaluators): update runtime urls (#298)" This reverts commit 7027bbbb985b2e8e4d912f6d9e40c74e1bc19f1c. --- evaluators/contrib/galileo/README.md | 7 ------ .../decision_models/client.py | 8 +++---- .../llm/client.py | 10 ++++----- .../luna/client.py | 17 ++++---------- .../tests/test_decision_models_evaluator.py | 22 +++++++++---------- .../galileo/tests/test_llm_coverage_gaps.py | 15 ++++++------- .../galileo/tests/test_llm_evaluator.py | 2 +- .../galileo/tests/test_luna_coverage_gaps.py | 3 +-- .../galileo/tests/test_luna_evaluator.py | 12 +++------- 9 files changed, 35 insertions(+), 61 deletions(-) diff --git a/evaluators/contrib/galileo/README.md b/evaluators/contrib/galileo/README.md index daa5176b..8191bb73 100644 --- a/evaluators/contrib/galileo/README.md +++ b/evaluators/contrib/galileo/README.md @@ -16,13 +16,6 @@ set `threshold` and `operator` as needed. If you still need the legacy Luna2 evaluator, pin `agent-control-evaluator-galileo <8`. -Luna requests are sent to the Luna runtime service. Decision Models (Jev) and -LLM-as-judge requests are sent to the external runtime service configured by -`GALILEO_EXTERNAL_INVOKE_URL`. Runtime service-root URLs are expanded to -`/api/v1/scorers/invoke/runtime`; legacy Luna requests continue to use -`/api/v1/scorers/invoke` when the runtime feature flag is disabled. The external -URL is required for Jev and LLM-as-judge and never falls back to the Luna service. - The optional evaluator `config` mirrors Orbit's allowlisted scorer-invoke configuration. Supported keys are `threshold`, `score_threshold`, and `request_timeout_seconds`; unsupported keys are rejected locally before an HTTP diff --git a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/decision_models/client.py b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/decision_models/client.py index a7b26440..e5db9cc2 100644 --- a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/decision_models/client.py +++ b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/decision_models/client.py @@ -24,8 +24,8 @@ DEFAULT_TIMEOUT_SECS = 10.0 DEFAULT_INTERNAL_TOKEN_TTL_SECS = 3600 -DEFAULT_INVOKE_PATH = "/api/v1/scorers/invoke/runtime" -EXTERNAL_INVOKE_URL_ENV = "GALILEO_EXTERNAL_INVOKE_URL" +DEFAULT_INVOKE_PATH = "/api/v1/scorers/invoke" +LUNA_INVOKE_URL_ENV = "GALILEO_LUNA_INVOKE_URL" AUTH_UPSTREAM_CA_FILE_ENV = "AGENT_CONTROL_AUTH_UPSTREAM_CA_FILE" DEFAULT_KEEPALIVE_EXPIRY_SECS = 1.0 DEFAULT_MAX_CONNECTIONS = 100 @@ -185,9 +185,9 @@ def __init__( "GALILEO_API_SECRET_KEY or GALILEO_API_SECRET is required for " "galileo.decision_models" ) - resolved_url = invoke_url or os.getenv(EXTERNAL_INVOKE_URL_ENV) + resolved_url = invoke_url or os.getenv(LUNA_INVOKE_URL_ENV) if not resolved_url or not resolved_url.strip(): - raise ValueError(f"{EXTERNAL_INVOKE_URL_ENV} is required for galileo.decision_models") + raise ValueError(f"{LUNA_INVOKE_URL_ENV} is required for galileo.decision_models") self.api_secret = resolved_secret self.invoke_url = _normalize_invoke_url(resolved_url) self.runtime_enabled = scorer_invoke_runtime_enabled() diff --git a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/llm/client.py b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/llm/client.py index 9bb49a49..a8aa64d8 100644 --- a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/llm/client.py +++ b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/llm/client.py @@ -26,8 +26,8 @@ DEFAULT_TIMEOUT_SECS = 10.0 SERVER_TIMEOUT_RATIO = 0.8 DEFAULT_INTERNAL_TOKEN_TTL_SECS = 3600 -DEFAULT_LLM_SCORER_INVOKE_PATH = "/api/v1/scorers/invoke/runtime" -LLM_INVOKE_URL_ENV = "GALILEO_EXTERNAL_INVOKE_URL" +DEFAULT_LLM_SCORER_INVOKE_PATH = "/api/v1/scorers/invoke" +LLM_INVOKE_URL_ENV = "GALILEO_LUNA_INVOKE_URL" LLM_INVOKE_CA_FILE_ENV = "GALILEO_LUNA_INVOKE_CA_FILE" AUTH_UPSTREAM_CA_FILE_ENV = "AGENT_CONTROL_AUTH_UPSTREAM_CA_FILE" @@ -354,7 +354,7 @@ class GalileoLLMClient: GALILEO_FEATURE_FLAG_LLM_EVALUATOR: Set to ``enabled`` to activate the evaluator. Required; the evaluator is unavailable until this flag is set. GALILEO_API_SECRET_KEY or GALILEO_API_SECRET: JWT signing secret for internal auth. - GALILEO_EXTERNAL_INVOKE_URL: LLM scorer invoke URL or service root (required). + GALILEO_LUNA_INVOKE_URL: LLM scorer invoke URL or service root (required). GALILEO_LUNA_INVOKE_CA_FILE: CA bundle used to verify invoke TLS. AGENT_CONTROL_AUTH_UPSTREAM_CA_FILE: Shared internal CA fallback. GALILEO_LUNA_KEEPALIVE_EXPIRY_SECONDS: HTTP pooled connection expiry. @@ -375,7 +375,7 @@ def __init__( api_secret: Internal JWT signing secret. If not provided, reads from GALILEO_API_SECRET_KEY or GALILEO_API_SECRET. llm_invoke_url: LLM scorer invoke URL or service root. If not provided, - reads from GALILEO_EXTERNAL_INVOKE_URL. + reads from GALILEO_LUNA_INVOKE_URL. llm_invoke_ca_file: Optional CA bundle used to verify invoke TLS. If not provided, reads from GALILEO_LUNA_INVOKE_CA_FILE, then AGENT_CONTROL_AUTH_UPSTREAM_CA_FILE. @@ -397,7 +397,7 @@ def __init__( resolved_llm_invoke_url = llm_invoke_url or os.getenv(LLM_INVOKE_URL_ENV) if resolved_llm_invoke_url is None or resolved_llm_invoke_url.strip() == "": raise ValueError( - "GALILEO_EXTERNAL_INVOKE_URL is required for LLM scorer invocation. " + "GALILEO_LUNA_INVOKE_URL is required for LLM scorer invocation. " "Set it as an environment variable or pass it to the constructor." ) diff --git a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/client.py b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/client.py index 74fb8b9a..c2111ace 100644 --- a/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/client.py +++ b/evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/client.py @@ -27,7 +27,6 @@ SERVER_TIMEOUT_RATIO = 0.8 DEFAULT_INTERNAL_TOKEN_TTL_SECS = 3600 DEFAULT_LUNA_SCORER_INVOKE_PATH = "/api/v1/scorers/invoke" -DEFAULT_LUNA_RUNTIME_SCORER_INVOKE_PATH = "/api/v1/scorers/invoke/runtime" LUNA_INVOKE_URL_ENV = "GALILEO_LUNA_INVOKE_URL" LUNA_INVOKE_CA_FILE_ENV = "GALILEO_LUNA_INVOKE_CA_FILE" AUTH_UPSTREAM_CA_FILE_ENV = "AGENT_CONTROL_AUTH_UPSTREAM_CA_FILE" @@ -89,18 +88,13 @@ def _internal_auth_token( return f"{signing_input}.{_b64url(signature)}" -def _normalize_luna_invoke_url(raw_url: str, *, runtime_enabled: bool) -> str: - """Use full invoke URLs as-is and append the active path to bare service roots.""" +def _normalize_luna_invoke_url(raw_url: str) -> str: + """Use full invoke URLs as-is and append the default path to bare service roots.""" url = raw_url.strip().rstrip("/") parsed = urlsplit(url) if parsed.path not in ("", "/") or parsed.query or parsed.fragment: return url - invoke_path = ( - DEFAULT_LUNA_RUNTIME_SCORER_INVOKE_PATH - if runtime_enabled - else DEFAULT_LUNA_SCORER_INVOKE_PATH - ) - return f"{url}{invoke_path}" + return f"{url}{DEFAULT_LUNA_SCORER_INVOKE_PATH}" def _load_float_env(env_name: str, default: float) -> float: @@ -423,10 +417,7 @@ def __init__( self.api_secret = resolved_api_secret self.runtime_enabled = scorer_invoke_runtime_enabled() - self.luna_invoke_url = _normalize_luna_invoke_url( - resolved_luna_invoke_url, - runtime_enabled=self.runtime_enabled, - ) + self.luna_invoke_url = _normalize_luna_invoke_url(resolved_luna_invoke_url) self.luna_invoke_ca_file = ( luna_invoke_ca_file or os.getenv(LUNA_INVOKE_CA_FILE_ENV) diff --git a/evaluators/contrib/galileo/tests/test_decision_models_evaluator.py b/evaluators/contrib/galileo/tests/test_decision_models_evaluator.py index 8a2ac341..3b5fdcdf 100644 --- a/evaluators/contrib/galileo/tests/test_decision_models_evaluator.py +++ b/evaluators/contrib/galileo/tests/test_decision_models_evaluator.py @@ -53,7 +53,7 @@ def _decode_jwt_segment(segment: str) -> dict[str, Any]: def _evaluator(monkeypatch: pytest.MonkeyPatch, **config: Any) -> DecisionModelsEvaluator: monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") - monkeypatch.setenv("GALILEO_EXTERNAL_INVOKE_URL", "http://runners-external:8090") + monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://runners:8090") monkeypatch.setenv("GALILEO_FEATURE_FLAG_SCORER_INVOKE_RUNTIME", "enabled") monkeypatch.setenv("GALILEO_FEATURE_FLAG_DECISION_MODELS_EVALUATOR", "enabled") evaluator = DecisionModelsEvaluator( @@ -156,31 +156,29 @@ def test_config_allows_missing_threshold_for_any_operator() -> None: @pytest.mark.asyncio -async def test_client_url_resolution_prefers_explicit_url_then_external_environment( +async def test_client_url_resolution_prefers_explicit_url_then_luna_environment( monkeypatch: pytest.MonkeyPatch, ) -> None: monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://luna:8090") - monkeypatch.setenv("GALILEO_EXTERNAL_INVOKE_URL", "http://external:8090") explicit_client = GalileoDecisionModelsClient(invoke_url="http://explicit:8090") environment_client = GalileoDecisionModelsClient() - expected_path = "/api/v1/scorers/invoke/runtime" + expected_path = "/api/v1/scorers/invoke" assert explicit_client.invoke_url == f"http://explicit:8090{expected_path}" - assert environment_client.invoke_url == f"http://external:8090{expected_path}" + assert environment_client.invoke_url == f"http://luna:8090{expected_path}" await explicit_client.close() await environment_client.close() -def test_client_requires_external_invoke_url_when_no_explicit_url_is_given( +def test_client_requires_luna_invoke_url_when_no_explicit_url_is_given( monkeypatch: pytest.MonkeyPatch, ) -> None: monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") - monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://luna:8090") - monkeypatch.delenv("GALILEO_EXTERNAL_INVOKE_URL", raising=False) + monkeypatch.delenv("GALILEO_LUNA_INVOKE_URL", raising=False) - with pytest.raises(ValueError, match="GALILEO_EXTERNAL_INVOKE_URL"): + with pytest.raises(ValueError, match="GALILEO_LUNA_INVOKE_URL"): GalileoDecisionModelsClient() @@ -441,7 +439,7 @@ async def test_client_serializes_full_record_context_and_uses_timeout( monkeypatch: pytest.MonkeyPatch, record_type: str ) -> None: monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") - monkeypatch.setenv("GALILEO_EXTERNAL_INVOKE_URL", "http://runners-external:8090") + monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://runners:8090") monkeypatch.setenv("GALILEO_FEATURE_FLAG_SCORER_INVOKE_RUNTIME", "enabled") client = GalileoDecisionModelsClient() seen: dict[str, Any] = {} @@ -520,7 +518,7 @@ async def handler(request: httpx.Request) -> httpx.Response: timeout=5.0, ) assert response.score == 0.9 - assert seen["url"] == "http://runners-external:8090/api/v1/scorers/invoke/runtime" + assert seen["url"] == "http://runners:8090/api/v1/scorers/invoke" payload = json.loads(seen["payload"]) assert payload["scorer_version_id"] == "version-a" assert payload["execution_context"]["user_id"] == "user-7" @@ -812,7 +810,7 @@ def test_numeric_comparison_rejects_non_numeric_threshold_from_unvalidated_confi monkeypatch: pytest.MonkeyPatch, ) -> None: monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") - monkeypatch.setenv("GALILEO_EXTERNAL_INVOKE_URL", "http://runners-external:8090") + monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://runners:8090") config = DecisionModelsEvaluatorConfig.model_construct( scorer_id="scorer-a", scorer_version_id="version-a", diff --git a/evaluators/contrib/galileo/tests/test_llm_coverage_gaps.py b/evaluators/contrib/galileo/tests/test_llm_coverage_gaps.py index 25bf0dff..95751ef5 100644 --- a/evaluators/contrib/galileo/tests/test_llm_coverage_gaps.py +++ b/evaluators/contrib/galileo/tests/test_llm_coverage_gaps.py @@ -16,7 +16,7 @@ LLM_ENV = { "GALILEO_API_SECRET_KEY": "test-secret", - "GALILEO_EXTERNAL_INVOKE_URL": "http://external-invoke:8090", + "GALILEO_LUNA_INVOKE_URL": "http://luna-invoke:8090", "GALILEO_FEATURE_FLAG_LLM_EVALUATOR": "enabled", } @@ -661,7 +661,7 @@ def test_client_raises_when_no_api_secret(monkeypatch): """The client requires GALILEO_API_SECRET_KEY or GALILEO_API_SECRET.""" for name in ("GALILEO_API_SECRET_KEY", "GALILEO_API_SECRET"): monkeypatch.delenv(name, raising=False) - monkeypatch.setenv("GALILEO_EXTERNAL_INVOKE_URL", "http://external-invoke:8090") + monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://luna-invoke:8090") from agent_control_evaluator_galileo.llm.client import GalileoLLMClient with pytest.raises(ValueError, match="GALILEO_API_SECRET_KEY or GALILEO_API_SECRET"): @@ -669,13 +669,12 @@ def test_client_raises_when_no_api_secret(monkeypatch): def test_client_raises_when_no_llm_invoke_url(monkeypatch): - """The client requires GALILEO_EXTERNAL_INVOKE_URL.""" + """The client requires GALILEO_LUNA_INVOKE_URL.""" monkeypatch.setenv("GALILEO_API_SECRET_KEY", "test-secret") - monkeypatch.setenv("GALILEO_LUNA_INVOKE_URL", "http://luna-invoke:8090") - monkeypatch.delenv("GALILEO_EXTERNAL_INVOKE_URL", raising=False) + monkeypatch.delenv("GALILEO_LUNA_INVOKE_URL", raising=False) from agent_control_evaluator_galileo.llm.client import GalileoLLMClient - with pytest.raises(ValueError, match="GALILEO_EXTERNAL_INVOKE_URL"): + with pytest.raises(ValueError, match="GALILEO_LUNA_INVOKE_URL"): GalileoLLMClient() @@ -703,7 +702,7 @@ def test_client_posts_to_correct_llm_invoke_endpoint(monkeypatch): client = GalileoLLMClient() endpoint, _ = client._endpoint_and_auth_header() - assert endpoint == "http://external-invoke:8090/api/v1/scorers/invoke/runtime" + assert endpoint == "http://luna-invoke:8090/api/v1/scorers/invoke" def test_client_does_not_use_old_api_paths(monkeypatch): @@ -716,7 +715,7 @@ def test_client_does_not_use_old_api_paths(monkeypatch): endpoint, _ = client._endpoint_and_auth_header() assert "/scorers/invoke" in endpoint - assert endpoint.startswith("http://external-invoke:8090/api/v1/") + assert endpoint.startswith("http://luna-invoke:8090/api/v1/") assert "/internal/scorers/invoke" not in endpoint diff --git a/evaluators/contrib/galileo/tests/test_llm_evaluator.py b/evaluators/contrib/galileo/tests/test_llm_evaluator.py index 7866ce6e..8388a298 100644 --- a/evaluators/contrib/galileo/tests/test_llm_evaluator.py +++ b/evaluators/contrib/galileo/tests/test_llm_evaluator.py @@ -10,7 +10,7 @@ LLM_ENV = { "GALILEO_API_SECRET_KEY": "test-secret", - "GALILEO_EXTERNAL_INVOKE_URL": "http://external-invoke:8090", + "GALILEO_LUNA_INVOKE_URL": "http://luna-invoke:8090", "GALILEO_FEATURE_FLAG_LLM_EVALUATOR": "enabled", } diff --git a/evaluators/contrib/galileo/tests/test_luna_coverage_gaps.py b/evaluators/contrib/galileo/tests/test_luna_coverage_gaps.py index 5d2ad621..c5b65e7b 100644 --- a/evaluators/contrib/galileo/tests/test_luna_coverage_gaps.py +++ b/evaluators/contrib/galileo/tests/test_luna_coverage_gaps.py @@ -459,13 +459,12 @@ def test_client_posts_to_correct_luna_invoke_endpoint(monkeypatch): """_endpoint_and_auth_header must return the Luna invoke endpoint path.""" for key, value in LUNA_ENV.items(): monkeypatch.setenv(key, value) - monkeypatch.setenv("GALILEO_FEATURE_FLAG_SCORER_INVOKE_RUNTIME", "enabled") from agent_control_evaluator_galileo.luna.client import GalileoLunaClient client = GalileoLunaClient() endpoint, _ = client._endpoint_and_auth_header() - assert endpoint == "http://luna-invoke:8090/api/v1/scorers/invoke/runtime" + assert endpoint == "http://luna-invoke:8090/api/v1/scorers/invoke" def test_client_does_not_use_old_api_paths(monkeypatch): diff --git a/evaluators/contrib/galileo/tests/test_luna_evaluator.py b/evaluators/contrib/galileo/tests/test_luna_evaluator.py index 4d234c83..7589270e 100644 --- a/evaluators/contrib/galileo/tests/test_luna_evaluator.py +++ b/evaluators/contrib/galileo/tests/test_luna_evaluator.py @@ -361,9 +361,7 @@ def test_client_normalizes_luna_invoke_service_root(self) -> None: ): client = GalileoLunaClient() - assert client.luna_invoke_url == ( - "http://luna-invoke:8090/api/v1/scorers/invoke/runtime" - ) + assert client.luna_invoke_url == "http://luna-invoke:8090/api/v1/scorers/invoke" def test_client_uses_full_luna_invoke_url_as_configured(self) -> None: from agent_control_evaluator_galileo.luna import GalileoLunaClient @@ -695,11 +693,9 @@ def handler(request: httpx.Request) -> httpx.Response: finally: await client.close() - # Then: posts to the Luna runtime endpoint with JWT and no Galileo-API-Key + # Then: posts to luna invoke endpoint /api/v1/scorers/invoke with JWT, no Galileo-API-Key assert response.score == 0.82 - assert captured["url"] == ( - "http://luna-invoke:8090/api/v1/scorers/invoke/runtime" - ) + assert captured["url"] == "http://luna-invoke:8090/api/v1/scorers/invoke" expected_body = { "scorer_id": SCORER_ID, "execution_context": { @@ -905,7 +901,6 @@ async def test_client_uses_legacy_request_without_runtime_flag( captured: dict[str, object] = {} def handler(request: httpx.Request) -> httpx.Response: - captured["url"] = str(request.url) captured["body"] = json.loads(request.content.decode()) return httpx.Response(200, json={"score": 0.8, "status": "success"}) @@ -938,7 +933,6 @@ def handler(request: httpx.Request) -> httpx.Response: body = captured["body"] assert isinstance(body, dict) - assert captured["url"] == "http://luna-invoke:8090/api/v1/scorers/invoke" assert body["scorer_id"] == SCORER_ID assert body["scorer_version_id"] == SCORER_VERSION_ID assert body["inputs"] == {