Skip to content

feat(eval): add runtime simulation via --simulation flag#1624

Merged
AAgnihotry merged 9 commits into
mainfrom
feat/runtimeSimualtion
May 12, 2026
Merged

feat(eval): add runtime simulation via --simulation flag#1624
AAgnihotry merged 9 commits into
mainfrom
feat/runtimeSimualtion

Conversation

@AAgnihotry
Copy link
Copy Markdown
Contributor

@AAgnihotry AAgnihotry commented May 11, 2026

Summary

  • Adds --simulation flag to uipath run that accepts a JSON config (same schema as simulation.json) to wrap the runtime with UiPathMockRuntime
  • Exports build_mocking_context_from_dict from uipath.eval.mocks for use by the CLI
  • Adds runtime-simulations-agent sample demonstrating @mockable-decorated tools with a simulation.json
  • Adds simulation-testcase integration testcase with run.sh + src/assert.py that verifies simulation was triggered (log lines + non-default LLM output)
  • Bumps version to 2.10.63

Test plan

  • All 1840 existing unit tests pass (uv run pytest)
  • No lint errors (ruff check, ruff format --check, lint_httpx_client.py)
  • Run sample locally: cd packages/uipath/samples/runtime-simulations-agent && uv run uipath run main -f input.json --simulation "$(cat simulation.json)"
  • Integration testcase runs via integration_tests.yml when uipath package changes

Context notes

  • Vertical Solutions team doesn't use Orchestrator.

🤖 Generated with Claude Code

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels May 11, 2026
- Add --simulation flag to uipath run accepting JSON (same schema as simulation.json)
- Wrap runtime with UiPathMockRuntime when simulation config is provided
- Export build_mocking_context_from_dict from eval.mocks for use by CLI
- Add runtime-simulations-agent sample demonstrating @mockable tools
- Add simulation-testcase with run.sh and assert.py verifying LLM simulation
- Fix dict type annotation in cli_run (mypy)
- Bump version to 2.10.63

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AAgnihotry AAgnihotry force-pushed the feat/runtimeSimualtion branch from 5549c35 to 4528fb2 Compare May 11, 2026 16:36
AAgnihotry and others added 3 commits May 11, 2026 09:44
- Add UiPathMockRuntime tests: execute/stream with context, get_schema,
  mocker creation failure handler
- Add TestRunSimulation to test_run: invalid JSON, wrapping, disabled cases
- Fix run.sh to use LOG_LEVEL=DEBUG so simulation log lines appear in run.log
- Restore assert.py log-based checks that verify simulation was triggered

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@Chibionos Chibionos left a comment

Choose a reason for hiding this comment

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

/deep-review — overall

Verdict: Comment. Two P1s (one Pydantic validation gap, one runtime-lifecycle leak that Codex caught and I verified), two P2s, one P3. All findings are inline below — each can be resolved / replied to individually.

Slop meter

🟢 clean — slop 4/100 · tunnel-vision 0/100. The 4 points are version literals in pyproject.toml files, expected for sample/testcase scaffolding.

Codex recheck

Verdict: amend — Codex agreed with my four draft findings and surfaced one P1 I'd missed (runtime-lifecycle leak), now F2.

Findings index (all inline)

# Sev File:Line Headline
F1 P1 _mock_runtime.py:38 Loose dict[str, Any] input — no Pydantic validation
F2 P1 cli_run.py:249 Simulated run leaks the delegate runtime (Codex catch)
F3 P2 cli_run.py:107 --simulation accepts inline JSON only — awkward UX
F4 P2 testcases/simulation-testcase/main.py Sample + testcase duplicate the same fixture
F5 P3 _mock_runtime.py:77 logger.info likely too chatty — consider logger.debug

Pillar 15 — Python Service Discipline

The deep-review skill grew a Python pillar today, distilled from 104 review comments by @cristipufu and @radu-mocanu on this repo over the last 120 days. F1 and F4 trace directly back to patterns those two flag repeatedly. The full pillar lives at skills-internal#299 (plugins/deep-review/skills/deep-review/references/default-pillars.md).

Comment thread packages/uipath/src/uipath/eval/mocks/_mock_runtime.py Outdated
Comment thread packages/uipath/src/uipath/_cli/cli_run.py
Comment thread packages/uipath/src/uipath/_cli/cli_run.py
Comment thread packages/uipath/testcases/simulation-testcase/main.py Outdated
Comment thread packages/uipath/src/uipath/eval/mocks/_mock_runtime.py Outdated
AAgnihotry and others added 2 commits May 11, 2026 10:51
…mocking_context

- Add SimulationConfig to _types.py with toolsToSimulate alias and strict validation
- Add build_mocking_context(config: SimulationConfig) as the typed entry point
- Keep build_mocking_context_from_dict as a thin wrapper for backward compat
- Update cli_run.py to validate --simulation via SimulationConfig.model_validate_json
- Export SimulationConfig and build_mocking_context from mocks __init__
- Fix delegate runtime leak: keep base_runtime ref so finally always disposes it
- Remove duplicate agent files from simulation-testcase; run.sh points to sample

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@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 →

@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 →

Comment thread packages/uipath/src/uipath/_cli/cli_run.py
@sonarqubecloud
Copy link
Copy Markdown

@AAgnihotry AAgnihotry merged commit dc5319f into main May 12, 2026
161 checks passed
@AAgnihotry AAgnihotry deleted the feat/runtimeSimualtion branch May 12, 2026 21:14
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