fix(eval): stop stripping -community-agents model suffix before calling LLM Gateway#1803
Open
Chibionos wants to merge 3 commits into
Open
fix(eval): stop stripping -community-agents model suffix before calling LLM Gateway#1803Chibionos wants to merge 3 commits into
Chibionos wants to merge 3 commits into
Conversation
… Gateway LLM-judge evaluators (current-gen and legacy) removed the "-community-agents" suffix from the configured model name before calling UiPathLlmChatService. That suffix is not cosmetic: Community/EU tenants' LLM Gateway routing rules are keyed on the suffixed model id -- the same id AgentHub sends unmodified when it runs the agent itself. Stripping it sends a bare model id the Gateway has no EU routing rule for, causing a 417 "No llm routing rule found for product agentsplaygroundfallback in EU using model ..." on every Community/EU evaluation run, even though the identical model id works for the agent. Removes the strip from llm_as_judge_evaluator.py (covers both the output-similarity and trajectory current-gen judges), legacy_llm_as_judge_evaluator.py, legacy_trajectory_evaluator.py, and the shared clean_model_name() helper used by legacy_context_precision and legacy_faithfulness evaluators. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5DrPWsvEMA5UdzVtnsvuM
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes LLM-judge evaluators to pass the configured model ID to the LLM Gateway unchanged, specifically preserving the -community-agents suffix required for Community/EU routing rules.
Changes:
- Removed
-community-agentssuffix stripping in both current-gen and legacy LLM-judge evaluator call paths. - Deleted the legacy
clean_model_name()helper and updated its prior call sites to use the model value as-is. - Added regression tests to assert the exact model string is forwarded into
chat_completions(...)for each affected evaluator path.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath/src/uipath/eval/evaluators/llm_as_judge_evaluator.py | Stop stripping -community-agents in LLMJudgeMixin._get_llm_response so the Gateway receives the configured model ID. |
| packages/uipath/src/uipath/eval/evaluators/legacy_llm_as_judge_evaluator.py | Stop stripping -community-agents in the legacy LLM-as-a-judge evaluator request path. |
| packages/uipath/src/uipath/eval/evaluators/legacy_trajectory_evaluator.py | Stop stripping -community-agents in the legacy trajectory evaluator request path. |
| packages/uipath/src/uipath/eval/evaluators/legacy_context_precision_evaluator.py | Remove use of clean_model_name() and forward self.model directly. |
| packages/uipath/src/uipath/eval/evaluators/legacy_faithfulness_evaluator.py | Remove use of clean_model_name() and forward self.model directly. |
| packages/uipath/src/uipath/eval/evaluators/legacy_evaluator_utils.py | Remove now-dead clean_model_name() helper. |
| packages/uipath/tests/evaluators/test_llm_judge_model_suffix.py | Add regression tests asserting the configured (suffixed) model ID is what reaches the LLM call for each fixed code path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Patch release for the -community-agents suffix fix so it can publish to PyPI once merged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5DrPWsvEMA5UdzVtnsvuM
- Fix mypy errors in the new suffix test: missing config_type / evaluation_criteria_type / justification_type on the legacy context-precision and faithfulness constructors, and use AsyncMock instead of SimpleNamespace for the .llm attribute (typed as UiPathLlmChatService | None). - Drop the explanatory comments left over the four fixed call sites -- the code (model = self.model) is self-evident on its own. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5DrPWsvEMA5UdzVtnsvuM
|
🚨 Heads up:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
LLM-judge evaluators (both current-gen and legacy) strip the
-community-agentssuffix off the configured model name before calling
UiPathLlmChatService. Thatsuffix is not cosmetic — Community/EU tenants' LLM Gateway routing rules are keyed
on the suffixed model id, the same id AgentHub sends unmodified when it runs
the agent itself. Stripping it before the eval call sends a bare model id the
Gateway has no EU routing rule for:
...even though the agent using the identical
gpt-5.4-2026-03-05-community-agentsid runs fine, and the evaluator's own config has the identical suffixed id.
Confirmed via production trace: the "Autonomous Agent" span completes successfully
while the
llm-judge-trajectory-eval-001evaluator span 417s on the very samemodel string minus the suffix.
The strip was introduced from-scratch in #483 (Jul 2025) with no recorded
rationale (no PR description/review comment references it), and was copy-pasted
into 3 more evaluator files as the eval framework grew. It never accounted for
Community/EU Gateway routing.
Changes
llm_as_judge_evaluator.py(LLMJudgeMixin._get_llm_response) — covers bothcurrent-gen
uipath-llm-judge-output-semantic-similarityanduipath-llm-judge-trajectory-similarityevaluators (this is the exact path hitin the production incident).
legacy_llm_as_judge_evaluator.py,legacy_trajectory_evaluator.py— same strip,legacy evaluator classes.
legacy_evaluator_utils.py— removed the now-deadclean_model_name()helperand its two call sites in
legacy_context_precision_evaluator.py/legacy_faithfulness_evaluator.py.The
COMMUNITY_agents_SUFFIXconstant itself is left in place inuipath.platform.constants(still covered by the backward-compat shim test) —only its use inside these six evaluator call sites is removed.
Test plan
tests/evaluators/test_llm_judge_model_suffix.py— one test per fixedcode path, mocking the LLM service and asserting the model id reaching
chat_completions(...)matches the configured (suffixed) value exactly.Watched all 6 fail against the pre-fix code (bare model name), then pass
after the fix.
uipathpackage test suite passes (uv run pytest, no regressions).ruff check,ruff format --check,mypyclean on all touched files.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01P5DrPWsvEMA5UdzVtnsvuM