Skip to content

feat(cli): update the IPC IPythonJobApi contract - #1906

Merged
eduard-dumitru merged 1 commit into
mainfrom
feat/python-job-api-contract
Sep 22, 2026
Merged

eduard-dumitru merged 1 commit into
mainfrom
feat/python-job-api-contract

Conversation

@eduard-dumitru

@eduard-dumitru eduard-dumitru commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What

The handler is moving the Python job api to its own CoreIPC contract, IPythonJobApi (UiPath/hdens#8031), instead of sharing the JS one. This PR makes uipath run and uipath server speak it.

  • Endpoint key IPythonJobApi; methods SendLog(PythonJobLogDto) and SetResult(PythonJobResultDto), one DTO parameter each.
  • Every DTO names the run it belongs to: JobKey + ResumeVersion. The pooled server takes them from the RunJob request; uipath run takes the key from UIPATH_JOB_KEY (no resume version on that lane today, sent as null).
  • Wire keys are PascalCase throughout, matching the peer's property names; its camelCase JSON names on the shared base bind case-insensitively (verified against the .NET DTOs).

Why the rename

The old shared contract had a parameter named jobId that Python filled with the job key. Giving Python its own contract makes the identifier honest and lets the handler route pooled callbacks by (JobKey, ResumeVersion), dropping a previous resume's stragglers instead of delivering them into the current run.

Compatibility

Gated off in production: the handler only arms the IPC job api behind FPS flags that are off, and it will raise its uipath version floor to this release before turning them on. Older handlers never call this contract.

Testing

tests/cli/test_job_api.py and tests/cli/test_server_ipc.py updated (49 tests, including a real in-proc pipe round trip of both DTOs). Full packages/uipath suite green; mypy clean; ruff clean.

Version bumped to 2.14.24.

Copilot AI lite review requested due to automatic review settings September 21, 2026 16:53
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Sep 21, 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.

Copilot review overview

🔵 Needs a closer look

It changes an IPC wire contract and cross-process messaging semantics, which warrants final human verification despite strong test updates.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Updates the uipath CLI’s IPC job-callback contract to a Python-specific IPythonJobApi, ensuring every log/result DTO includes (JobKey, ResumeVersion) metadata and adding UTC timestamps to streamed log entries so the handler can attribute emission time correctly.

Changes:

  • Introduces IPythonJobApi with SendLog(PythonJobLogDto) / SetResult(PythonJobResultDto) and migrates DTOs to PascalCase wire keys plus run identification fields.
  • Updates the pooled runtime server path (uipath server) to request/install sinks using the new contract and to include ResumeVersion.
  • Updates CLI tests to pin the new on-wire key sets and validate real named-pipe round-trips for both DTOs; bumps version to 2.14.24.
File Description
packages/​uipath/​src/​uipath/​_cli/​_job_api.py Defines IPythonJobApi, new DTOs, and updates sink/log/result forwarding to include run identity and log timestamps.
packages/​uipath/​src/​uipath/​_cli/​cli_server_ipc.py Switches pooled server callback contract to IPythonJobApi and passes through ResumeVersion to sink installation.
packages/​uipath/​tests/​cli/​test_job_api.py Updates assertions and wire-key pinning for the new PascalCase DTO contract and new method signatures.
packages/​uipath/​tests/​cli/​test_server_ipc.py Updates named-pipe integration test to use IPythonJobApi and validates streamed DTO contents via real IPC.
packages/​uipath/​pyproject.toml Bumps package version to 2.14.24.
packages/​uipath/​uv.lock Updates locked version to 2.14.24.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 360 to 364
def is_wire_job_id(job_id: str | None) -> TypeGuard[str]:
"""The peer types the job id as a Guid, and routes nothing for one it can't match."""
"""The peer types the job key as a Guid, and routes nothing for one it can't match."""
try:
parsed = uuid.UUID(str(job_id))
except ValueError:
Comment on lines +136 to +138
installed.append(
install_runtime_sinks(job_key, callback, loop, resume_version)
)
@eduard-dumitru eduard-dumitru changed the title feat(cli): speak the handler's IPythonJobApi contract, naming the run on every message feat(cli): update the IPC IPythonJobApi contract Sep 21, 2026
@eduard-dumitru
eduard-dumitru force-pushed the feat/python-job-api-contract branch from 5d69e08 to 7087f5b Compare September 21, 2026 17:08
… on every message

The handler now hosts a Python-specific job api instead of sharing the JS one, and it routes
pooled callbacks by job key and resume version. Every log and result DTO carries JobKey and
ResumeVersion inline; both are required inputs, so a lane states None on purpose rather than by
omission.

Wire keys are PascalCase throughout, matching the peer's property names. Gated off in production
until the handler raises its version floor to this release.
@eduard-dumitru
eduard-dumitru force-pushed the feat/python-job-api-contract branch from 7da1aa6 to 8838c75 Compare September 22, 2026 07:11
@sonarqubecloud

Copy link
Copy Markdown

@eduard-dumitru
eduard-dumitru merged commit 6443e4d into main Sep 22, 2026
187 checks passed
@eduard-dumitru
eduard-dumitru deleted the feat/python-job-api-contract branch September 22, 2026 07:24
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