fix(eval): strip restricted temperature for default-only models in mocks#1741
Open
cotovanu-cristian wants to merge 1 commit into
Open
fix(eval): strip restricted temperature for default-only models in mocks#1741cotovanu-cristian wants to merge 1 commit into
cotovanu-cristian wants to merge 1 commit into
Conversation
The LLM mock generator forwarded the simulation strategy's temperature verbatim to the LLM Gateway. For models that only accept the default temperature (gpt-5 family, o-series reasoning models), an explicit temperature=0 makes the gateway return HTTP 400, which collapses into an Unknown-category runtime failure. Normalize completion kwargs at the structured-output funnel so the restricted temperature is dropped before calling chat_completions for those models, leaving standard models untouched. Refs SRE-607465, PC-4769. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes eval-time LLM mock generation failures by normalizing completion_kwargs in the shared structured-output funnel so that models which only allow the gateway’s default temperature (notably gpt-5 and o* reasoning models) do not receive an explicit temperature parameter that triggers HTTP 400s.
Changes:
- Added model detection + normalization logic in
generate_structured_output()to droptemperaturefor default-only-temperature models before callingchat_completions. - Added regression tests ensuring
temperatureis stripped forgpt-5/o1/o3models and preserved for standard models.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/uipath/src/uipath/eval/mocks/_structured_output.py |
Normalizes completion_kwargs to omit temperature for models that reject explicit temperature values. |
packages/uipath/tests/cli/eval/mocks/test_structured_output.py |
Adds regression coverage verifying stripping behavior for default-only models and non-stripping for standard models. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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
The eval LLM mock generator forwarded the simulation strategy's
temperatureverbatim to the LLM Gateway. For models that only accept the default temperature (gpt-5 family, o-series reasoning models), an explicittemperature=0makes the gateway return HTTP 400 (Unsupported value: 'temperature' does not support 0 with this model. Only the default (1) value is supported.). That error collapses throughUiPathMockResponseGenerationError→AgentRuntimeErrorinto an Unknown-category runtime failure.This normalizes completion kwargs at the structured-output funnel (
generate_structured_output), dropping the restrictedtemperaturefor those models before callingchat_completions. Both the LLM mocker and the input mocker route through this funnel, so the path is covered once. Standard models are unaffected.Root cause
_llm_mocker.pybuildscompletion_kwargsfromModelSettingsand forwards them tochat_completions, which always sendstemperaturein the request body.9dc7655c-241d-4a9d-a190-1545df616acc.Changes
_structured_output.py: add_model_supports_only_default_temperature+_normalize_completion_kwargs, applied once ingenerate_structured_output.test_structured_output.py: parametrized regression tests for gpt-5/o-series (temperature stripped) and a guard that standard models keep it.Not included
Preserving the underlying HTTP error category on
UiPathMockResponseGenerationErrorwas scoped out: it requires new category plumbing on a shared exception type used across the mocker modules and the runtime's category logic (not localized). The temperature fix removes the miscategorized failures at the source.Testing
ruff check + format clean; mypy clean on changed files;
pytest tests/cli/eval/mocks/= 65 passed.Refs: SRE-607465, PC-4769