feat(cli): serve the pre-warmed runtime over uipath-ipc alongside HTTP [ROBO-5779]#1809
feat(cli): serve the pre-warmed runtime over uipath-ipc alongside HTTP [ROBO-5779]#1809eduard-dumitru wants to merge 5 commits into
Conversation
72b8383 to
952d047
Compare
832a0f2 to
a641162
Compare
…P [ROBO-5779] `uipath server` serves an HTTP channel and, when --server-socket is given, a uipath-ipc named-pipe channel concurrently — both behind one env/cwd-isolated job core. Adds the IPythonRuntimeServer contract (StartJob/StopJob) with typed PythonRunRequest/PythonRunResult dataclasses mirroring the .NET side, plus tests. Adds uipath-ipc as a dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…OBO-5779] Move the wire-dictated PascalCase surface (PythonRunRequest/PythonRunResult, IPythonRuntimeServer, PythonRuntimeService, start_ipc_server) out of cli_server into cli_server_ipc, re-exported for backward compatibility. Scopes the Sonar S100/S116 suppression to that single file so the rest of the tree stays strict. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the missing/empty-Command rejection and the StopJob bool ack over the uipath-ipc channel, taking cli_server_ipc to full new-code coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Sonar: use resourceKey (not resourcePath) for the multicriteria issue ignore. - version: bump uipath 2.13.13 -> 2.13.14 (2.13.13 already on PyPI). - mypy: parametrize dict annotations in the server tests; ignore [type-abstract] on get_proxy(IPythonRuntimeServer) (proxying an interface is intended). - ruff: wrap over-long lines to the 88-col format. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c3a6d7d to
7e8f4fb
Compare
🚨 Heads up:
|
Add direct unit tests for _run_command_isolated's error paths (uninitialized state, bad working directory, SystemExit exit-code mapping, unexpected exception), lifting new-code coverage over the SonarCloud 90% gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7e8f4fb to
f8eff08
Compare
There was a problem hiding this comment.
Pull request overview
Adds a uipath-ipc named-pipe transport to uipath server, served concurrently with the existing HTTP transport, and refactors shared job execution into a single core path used by both transports.
Changes:
- Introduces an IPC contract/service (
IPythonRuntimeServer, DTOs,start_ipc_server) and runs it alongside the HTTP server when--server-socketis provided. - Extracts shared job execution into
_run_command_isolatedand routes HTTP/startthrough it. - Adds unit/integration tests covering transport composition, IPC behavior, and job-core error branches; updates packaging/sonar config for the new IPC module.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sonar-project.properties | Suppresses Sonar naming rules for PascalCase IPC contract/DTOs in cli_server_ipc.py only. |
| packages/uipath/uv.lock | Bumps uipath version and locks uipath-ipc dependency from internal feed. |
| packages/uipath/tests/cli/test_server_transport.py | Verifies _serve composes HTTP+IPC correctly and CLI wires args through. |
| packages/uipath/tests/cli/test_server_job_core.py | Unit tests for _run_command_isolated error/edge branches. |
| packages/uipath/tests/cli/test_server_ipc.py | IPC server tests (StartJob/StopJob + env isolation). |
| packages/uipath/src/uipath/_cli/cli_server.py | Adds IPC integration, shared job core, and updates HTTP handler to use it. |
| packages/uipath/src/uipath/_cli/cli_server_ipc.py | New IPC contract/DTOs/service and server bootstrap. |
| packages/uipath/pyproject.toml | Adds uipath-ipc to project dependencies and configures uv index pinning. |
Comments suppressed due to low confidence (1)
packages/uipath/src/uipath/_cli/cli_server.py:292
- When
_run_command_isolatedreports a request-shaped failure (e.g., invalid working directory), the HTTP response should keep a 4xx status instead of always defaulting to 200 for any nonzero ExitCode.
return web.json_response(
{"success": False, "job_key": job_key, "error": result["Error"]}
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return { | ||
| "ExitCode": 1, | ||
| "Error": f"Cannot change to working directory: {e}", | ||
| "Result": None, | ||
| "Unexpected": False, | ||
| } |
|
|
||
| JobKey: str = "" | ||
| Command: str = "" | ||
| Args: str | None = None |
| "uipath-core>=0.5.30, <0.6.0", | ||
| "uipath-runtime>=0.12.2, <0.13.0", | ||
| "uipath-platform>=0.2.4, <0.3.0", | ||
| "uipath-ipc>=2.5.1", |
| thread = threading.Thread(target=run_server, daemon=True) | ||
| thread.start() | ||
| time.sleep(0.5) |
|
radu-mocanu
left a comment
There was a problem hiding this comment.
Blocking: public install is broken
Please remove uipath-ipc from the required uipath dependencies, or publish it to public PyPI before merging. The PR note says the package currently resolves only from the internal Azure feed. That uv configuration is not included in the published wheel, so public pip install uipath cannot resolve this required dependency.
Also bound the runtime dependency’s minor version when it is released publicly, for example uipath-ipc>=2.5.1,<2.6.0, to protect consumers from incompatible minor releases.



Adds a uipath-ipc named-pipe transport to
uipath server, served alongside the existing HTTP-over-socket path (ROBO-5779).What
uipath serverserves both channels concurrently: HTTP (aiohttp over a Unix socket, or TCP on Windows) and — when--server-socketis given — a uipath-ipc named pipe. HTTP is never torn down; the IPC pipe name is the socket's basename, so the executor spawns the server the same way regardless of channel.IPythonRuntimeServer(StartJob/StopJob) viaNamedPipeServerTransport; both edges run jobs through one env/cwd-isolated core (_run_command_isolated).PythonRunRequest/PythonRunResult) mirroring the .NET side.StopJobreturns aboolso CoreIPC treats it as request/response, not fire-and-forget — cancellation itself is a no-op for now (Phase 1).uipath-ipc>=2.5.1(internal Azure Artifacts feed for now — see thepyprojectnote; a public-PyPIuipath-ipcrelease is a prerequisite for a publicpip install uipath).test_server_ipc.py(IPC server) andtest_server_transport.py(channel composition /_run_serverarg resolution / CLI wiring).Notes
PythonRuntimePreferIpcFPS feature flag, Low-Code only) — separate PR inUiPath/hdens.main; pending green CI (cross-tests + Sonar) before ready.🤖 Generated with Claude Code