Skip to content

feat(eval): add SimulateComponentMocker for per-component API-based simulation#1732

Merged
AAgnihotry merged 2 commits into
mainfrom
feat/simulate-component-mocker
Jun 22, 2026
Merged

feat(eval): add SimulateComponentMocker for per-component API-based simulation#1732
AAgnihotry merged 2 commits into
mainfrom
feat/simulate-component-mocker

Conversation

@AAgnihotry

@AAgnihotry AAgnihotry commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new components format to simulation.json that routes each tool call to the
    /agentsruntime_/api/execution/simulations/simulate-component API instead of the local LLM mocker
  • Introduces SimulateComponentMocker, SimulateComponentService, and 7 new types
    (SimulationStrategy, RuleOperator, SimulationAnswerType, SimulationAnswer,
    SimulationCondition, SimulationBehavior, ComponentSimulationConfig) mirroring the API contract
  • Legacy format (toolsToSimulate + instructions) is fully preserved — no breaking changes

Design decisions

  • Endpoint uses agentsruntime_ service prefix, which means UIPATH_SERVICE_URL_AGENTSRUNTIME
    env var can redirect to a local service for development
  • componentId in the payload uses the configured component ID (not the normalised invoked name)
    to ensure server-side simulation rules match correctly
  • Empty components: [] does not activate the API mocker (truthiness check, not is not None)

Test plan

  • Existing simulation tests pass (pytest tests/cli/test_debug_simulation.py)
  • New tests in tests/cli/eval/mocks/test_simulate_component.py all pass (coverage 100%)
  • ruff check . passes with no errors
  • mypy passes with no errors
  • Manual: run uipath debug with a simulation.json using the new components format and
    verify the API call is made to agentsruntime_/api/execution/simulations/simulate-component
  • Manual: verify legacy toolsToSimulate format still routes to the local LLM mocker

🤖 Generated with Claude Code

ANIPIK--FFQTDV0N47:simulate-component-agent anipik$ uv run uipath run main -f input.json --simulation "$(cat simulation.json)"  
Resource overwrites config file not found: __uipath/uipath.json
▶ START 
[simulate-component] mocker set: SimulateComponentMocker
simulate-component: mocker created (SimulateComponentMocker)
[simulate-component] get_mocked_response called for 'get_current_weather', mocker=SimulateComponentMocker
simulate-component: calling API for 'get_current_weather'
HTTP Request: POST https://alpha.uipath.com/agentsurt/DefaultTenant/agentsruntime_/api/execution/simulations/simulate-component "HTTP/1.1 200 OK"
simulate-component: 'get_current_weather' simulated successfully
[simulate-component] get_mocked_response called for 'get_forecast', mocker=SimulateComponentMocker
simulate-component: calling API for 'get_forecast'
HTTP Request: POST https://alpha.uipath.com/agentsurt/DefaultTenant/agentsruntime_/api/execution/simulations/simulate-component "HTTP/1.1 200 OK"
simulate-component: 'get_forecast' simulated successfully
● END
output
├── current (dict)
│   ├── city: London
│   ├── temperature: 6.5
│   ├── condition: cloudy
│   └── humidity: 70
├── forecast (list, 3 items)
│   ├── #0 (dict)
│   │   ├── date: 2024-01-15
│   │   ├── high: 8.0
│   │   ├── low: 3.0
│   │   └── condition: Partly cloudy
│   ├── #1 (dict)
│   │   ├── date: 2024-01-16
│   │   ├── high: 6.0
│   │   ├── low: 2.0
│   │   └── condition: Light rain
│   └── #2 (dict)
│       ├── date: 2024-01-17
│       ├── high: 7.0
│       ├── low: 4.0
│       └── condition: Overcast
└── summary: London: 6.5°C, cloudy. 3-day forecast available.
✓  Successful execution.
'id' field not present in uipath.json

Copilot AI review requested due to automatic review settings June 17, 2026 19:34
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jun 17, 2026

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.

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 + SimulateComponentMocker and routes mocking through them when components-based config is active.
  • Extends tests to cover loading the new components format 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.

Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py
Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py
Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_mocker_factory.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_mock_runtime.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_types.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_mock_context.py Outdated

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.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_mocker.py
Comment thread packages/uipath/src/uipath/eval/mocks/_simulate_component_service.py Outdated
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-integrations cross-tests are FAILING 🚨

Your changes may break one or more integrations in uipath-integrations-python:

  • uipath-openai-agents
  • uipath-google-adk
  • uipath-agent-framework
  • uipath-llamaindex
  • uipath-pydantic-ai

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@AAgnihotry AAgnihotry force-pushed the feat/simulate-component-mocker branch 2 times, most recently from 1cd9526 to 73ec8ff Compare June 22, 2026 18:05
@AAgnihotry AAgnihotry force-pushed the feat/simulate-component-mocker branch from ff012a3 to cff64d7 Compare June 22, 2026 18:35
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

Copy link
Copy Markdown

@smflorentino smflorentino self-requested a review June 22, 2026 23:21
@AAgnihotry AAgnihotry merged commit 3753803 into main Jun 22, 2026
238 of 240 checks passed
@AAgnihotry AAgnihotry deleted the feat/simulate-component-mocker branch June 22, 2026 23:23
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants