Skip to content

feat(cli): add uipath run --server-mode for the pooled coded-agent lane - #1875

Closed
eduard-dumitru wants to merge 2 commits into
mainfrom
feat/coded-server-mode
Closed

feat(cli): add uipath run --server-mode for the pooled coded-agent lane#1875
eduard-dumitru wants to merge 2 commits into
mainfrom
feat/coded-server-mode

Conversation

@eduard-dumitru

@eduard-dumitru eduard-dumitru commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

Adds uipath run --server-mode --ipc-pipe <name> — keeps the uipath run process alive and serves subsequent jobs over uipath-ipc (no HTTP channel, no ready-ACK), reporting each job's real exit code. uipath server is 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 the run verb keeps uipath server pristine and makes it clear what's being run.

Scope & safety

  • Additive and default-off: the exit-code surfacing is threaded through a surface_exit_code parameter (default False), so uipath server and the Low-Code path are byte-for-byte unchanged.
  • No new files; ~60 lines across cli_run.py, cli_server.py, cli_server_ipc.py, _server_core.py.

Testing

  • Unit tests for exit-code surfacing (on/off) + the --server-mode guard, and an end-to-end IPC test driving start_ipc_server(surface_exit_code=True) over a real named pipe.
  • ruff / format / mypy clean; full suite green (2392 passed, 1 skipped).

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 27, 2026 22:02
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Aug 27, 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

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 --coded flag to uipath server to run an IPC-only server lane (no HTTP channel).
  • Thread a surface_exit_code flag through the IPC runtime service into the shared job runner, and add unit tests for the new behavior.
  • Bump packages/uipath version to 2.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.

Comment on lines 83 to +93
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}",
Comment on lines +342 to +347
@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.",
)
@eduard-dumitru
eduard-dumitru force-pushed the feat/coded-server-mode branch from 70907e4 to b7e0192 Compare August 28, 2026 08:28
@eduard-dumitru eduard-dumitru changed the title feat(cli): add uipath server --coded for the pooled coded-agent lane feat(cli): add uipath run --server-mode for the pooled coded-agent lane Aug 28, 2026
@eduard-dumitru
eduard-dumitru force-pushed the feat/coded-server-mode branch 4 times, most recently from 71ea0a7 to 75c7df9 Compare August 28, 2026 11:31
if server_mode:
if not ipc_pipe:
console.error("--server-mode requires --ipc-pipe.")
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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()

@radu-mocanu radu-mocanu Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as discussed separately, this is out of scope

@eduard-dumitru
eduard-dumitru force-pushed the feat/coded-server-mode branch from 75c7df9 to bca8b4b Compare August 28, 2026 16:18
eduard-dumitru and others added 2 commits September 1, 2026 10:51
…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>
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 1, 2026

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 →

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 test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants