feat(cli): add uipath run --server-mode for the pooled coded-agent lane - #1875
feat(cli): add uipath run --server-mode for the pooled coded-agent lane#1875eduard-dumitru wants to merge 2 commits into
uipath run --server-mode for the pooled coded-agent lane#1875Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the uipath CLI server to add a new uipath server --coded --ipc-pipe <name> mode intended for a coded-agent, IPC-only serving lane, and introduces an optional mechanism to “surface” job exit codes through the IPC result contract.
Changes:
- Add
--codedflag touipath serverto run an IPC-only server lane (no HTTP channel). - Thread a
surface_exit_codeflag through the IPC runtime service into the shared job runner, and add unit tests for the new behavior. - Bump
packages/uipathversion to2.14.10.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/uipath/tests/cli/test_server.py |
Adds a CLI-level guard test ensuring --coded requires --ipc-pipe. |
packages/uipath/tests/cli/test_server_job_core.py |
Adds unit tests for exit-code surfacing behavior in the shared job core. |
packages/uipath/src/uipath/_cli/cli_server.py |
Adds --coded option and introduces run_ipc_server() for IPC-only serving. |
packages/uipath/src/uipath/_cli/cli_server_ipc.py |
Threads surface_exit_code through the IPC runtime service into job execution. |
packages/uipath/src/uipath/_cli/_server_core.py |
Implements optional exit-code surfacing based on command return value. |
packages/uipath/pyproject.toml |
Bumps the uipath package version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| result_value = await asyncio.to_thread( | ||
| cmd.main, args, standalone_mode=False | ||
| ) | ||
| exit_code = ( | ||
| result_value | ||
| if surface_exit_code and isinstance(result_value, int) | ||
| else 0 | ||
| ) | ||
| return { | ||
| "ExitCode": 0, | ||
| "Error": None, | ||
| "ExitCode": exit_code, | ||
| "Error": None if exit_code == 0 else f"Exit code: {exit_code}", |
| @click.option( | ||
| "--coded", | ||
| is_flag=True, | ||
| help="Serve only the uipath-ipc channel for coded agents (requires " | ||
| "--ipc-pipe); omit for the default HTTP server.", | ||
| ) |
70907e4 to
b7e0192
Compare
uipath server --coded for the pooled coded-agent laneuipath run --server-mode for the pooled coded-agent lane
71ea0a7 to
75c7df9
Compare
| if server_mode: | ||
| if not ipc_pipe: | ||
| console.error("--server-mode requires --ipc-pipe.") | ||
| return |
There was a problem hiding this comment.
nit: console.error already raises. no need for return
| # cli_server -> _server_core -> cli_run cycles at import time; defer it. | ||
| from .cli_server import preload_modules, run_ipc_server | ||
|
|
||
| preload_modules() |
There was a problem hiding this comment.
this will only load a few modules used by our SDK (a very small subset)
a coded agent can use ANY python library.
subsequent runs may (and probably will) still be very slow
we need to document how a developer can define a list of preloaded modules/generate them automatically at pack time
There was a problem hiding this comment.
as discussed separately, this is out of scope
75c7df9 to
bca8b4b
Compare
…lane Keep the uipath run process alive and serve subsequent jobs over uipath-ipc (no HTTP channel, no ready-ACK), surfacing each job's real exit code. Gated behind --server-mode via a default-off surface_exit_code param, so `uipath server` and the Low-Code path stay unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pooled server never unloads dependency modules between jobs: one interpreter, shared sys.modules, and the only eviction is the entrypoint's own dynamic_module (functions/runtime.py). Warming the SDK set at boot therefore only ever shaved the first job, and the runtime bootstrap already imports what a job needs. Measured ~0.67s boot cost for ~0 benefit, and it pulled in LowCode-only modules (pysignalr, socketio) the coded IPC lane never uses. The LowCode `uipath server` path keeps its own preload, untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
47e6f5a to
6caed80
Compare
|
🚨 Heads up:
|



What
Adds
uipath run --server-mode --ipc-pipe <name>— keeps theuipath runprocess alive and serves subsequent jobs over uipath-ipc (no HTTP channel, no ready-ACK), reporting each job's real exit code.uipath serveris left generic and unchanged.Why
The pooled server can't pre-warm generically — you don't know what to load until you have the package — so the natural model is
uipath run <job> --server-mode: prime on the first run, then stay alive to serve more over IPC. Putting the mode on therunverb keepsuipath serverpristine and makes it clear what's being run.Scope & safety
surface_exit_codeparameter (defaultFalse), souipath serverand the Low-Code path are byte-for-byte unchanged.cli_run.py,cli_server.py,cli_server_ipc.py,_server_core.py.Testing
--server-modeguard, and an end-to-end IPC test drivingstart_ipc_server(surface_exit_code=True)over a real named pipe.🤖 Generated with Claude Code