feat(eval): add SimulateComponentMocker for per-component API-based simulation#1732
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for a new simulation.json format that simulates tool/component calls by delegating to the /agentsruntime_/api/execution/simulations/simulate-component endpoint, while preserving the legacy toolsToSimulate + instructions local LLM mocker behavior.
Changes:
- Introduces per-component simulation schema/types (
components+ API-contract enums/models) and wires them into mocking context creation. - Adds
SimulateComponentService+SimulateComponentMockerand routes mocking through them when components-based config is active. - Extends tests to cover loading the new
componentsformat and updates legacy assertions accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath/tests/cli/test_debug_simulation.py | Adds a test for the new components simulation format and updates legacy assertions. |
| packages/uipath/src/uipath/eval/mocks/_types.py | Adds API-contract enums/models and extends SimulationConfig / MockingContext with components. |
| packages/uipath/src/uipath/eval/mocks/_simulate_component_service.py | New service wrapper around the simulate-component API endpoint. |
| packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py | New mocker that calls the simulate-component API per tool invocation. |
| packages/uipath/src/uipath/eval/mocks/_mocker_factory.py | Routes to the new mocker based on context. |
| packages/uipath/src/uipath/eval/mocks/_mock_runtime.py | Builds mocking context for new format and adjusts execution-context setup. |
| packages/uipath/src/uipath/eval/mocks/_mock_context.py | Updates tool-simulation detection to support components-based configs. |
| packages/uipath/src/uipath/eval/mocks/init.py | Exposes new types in the public mocks module API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
294eb67 to
213dc99
Compare
🚨 Heads up:
|
1cd9526 to
73ec8ff
Compare
ff012a3 to
cff64d7
Compare
🚨 Heads up:
|
|



Summary
componentsformat tosimulation.jsonthat routes each tool call to the/agentsruntime_/api/execution/simulations/simulate-componentAPI instead of the local LLM mockerSimulateComponentMocker,SimulateComponentService, and 7 new types(
SimulationStrategy,RuleOperator,SimulationAnswerType,SimulationAnswer,SimulationCondition,SimulationBehavior,ComponentSimulationConfig) mirroring the API contracttoolsToSimulate+instructions) is fully preserved — no breaking changesDesign decisions
agentsruntime_service prefix, which meansUIPATH_SERVICE_URL_AGENTSRUNTIMEenv var can redirect to a local service for development
componentIdin the payload uses the configured component ID (not the normalised invoked name)to ensure server-side simulation rules match correctly
components: []does not activate the API mocker (truthiness check, notis not None)Test plan
pytest tests/cli/test_debug_simulation.py)tests/cli/eval/mocks/test_simulate_component.pyall pass (coverage 100%)ruff check .passes with no errorsmypypasses with no errorsuipath debugwith asimulation.jsonusing the newcomponentsformat andverify the API call is made to
agentsruntime_/api/execution/simulations/simulate-componenttoolsToSimulateformat still routes to the local LLM mocker🤖 Generated with Claude Code