Skip to content

fix(eval): let coded agents pick the tool simulation model for BYOM tenants [AE-2294] - #1916

Open
Chibionos wants to merge 1 commit into
mainfrom
fix/byom-tool-simulation
Open

Chibionos wants to merge 1 commit into
mainfrom
fix/byom-tool-simulation

Conversation

@Chibionos

@Chibionos Chibionos commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Coded agent tool simulation always ran on gpt-4.1-mini-2025-04-14, so BYOM-only tenants get a governance 403 and the whole run dies with UiPathMockResponseGenerationError. Siemens Mobility is blocked on this (SF 03028630).

Why it happens

LLMMocker and LLMInputMocker fall back to ChatModels.gpt_4_1_mini_2025_04_14 when the strategy has no model. cli_run / cli_debug fill the model from schema.metadata["settings"]["model"], which only the low-code runtime sets from agent.json. Coded agents never set it, so every coded agent simulation goes to the UiPath-hosted default and skips AI Trust Layer BYOM. Turning simulation off works because the real tool path uses the customer's own model.

The fallback was also only logged. When no model was configured, completion_kwargs went out without one, so the LLM gateway client's own default decided the model.

What changed

  • New _simulation_model.py with simulation_completion_kwargs, used by both mockers. Model order: the strategy's model (simulation config or agent.json), then UIPATH_SIMULATION_MODEL, then the old default.
  • The resolved model is always in completion_kwargs, so what we log is what we send.
  • Version bump to 2.14.26.

For Siemens the fix is one line in the coded agent's .env: UIPATH_SIMULATION_MODEL=<their SDC alias>.

Call outs

  • Cache keys for simulations with no model now include the model, so existing cached mock responses for those runs miss once. This is intended: changing the env var should not serve a response generated by a different model.
  • This does not change the requesting_product / agenthub_config headers the mocker sends. If their policy is scoped by product, that is a separate follow-up.
  • Akshaya's proposal to expose an overridable mocker contract (register_llm_mocker, defaulting to the LLMGW mocker) is the longer-term fix and will come as a follow-up. This PR unblocks the customer without a new public API.

Testing

  • tests/cli/eval/mocks/test_simulation_model.py: resolver order, and an end-to-end mockable call with no model configured asserting X-UiPath-LlmGateway-NormalizedApi-ModelName carries the env model.
  • pytest tests/cli/eval green, ruff check, ruff format --check, mypy clean.

Jira: AE-2294

🤖 Generated with Claude Code

…enants [AE-2294]

Tool and input simulation fell back to a hardcoded gpt-4.1-mini whenever the
strategy had no model. Coded agents never carry a model in their runtime
schema, so every coded agent simulation hit the UiPath-hosted default, which
BYOM-only governance policies block. UIPATH_SIMULATION_MODEL now fills that
gap, and the resolved model is actually sent instead of only being logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 28, 2026 16:34
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Enables coded-agent simulations to select BYOM models through configurable model resolution, with uipath bumped to 2.14.26.

Changes:

  • Resolves models from strategy settings, UIPATH_SIMULATION_MODEL, or the legacy default.
  • Applies resolved models to mocker requests and cache keys.
  • Adds coverage for resolution and BYOM request propagation.
File Description
packages/​uipath/​uv.lock Updates locked package version.
packages/​uipath/​tests/​cli/​eval/​mocks/​test_simulation_model.py Tests model resolution and BYOM propagation.
packages/​uipath/​src/​uipath/​eval/​mocks/​_simulation_model.py Resolves simulation models.
packages/​uipath/​src/​uipath/​eval/​mocks/​_llm_mocker.py Uses resolved tool-simulation models.
packages/​uipath/​src/​uipath/​eval/​mocks/​_input_mocker.py Uses resolved input-generation models.
packages/​uipath/​pyproject.toml Bumps the package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

Copy link
Copy Markdown

@akshaylive akshaylive left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants