Skip to content

feat: add stable id to uipath.json for packaging and spans#1695

Merged
radu-mocanu merged 1 commit into
mainfrom
feat/agent-id
Jun 16, 2026
Merged

feat: add stable id to uipath.json for packaging and spans#1695
radu-mocanu merged 1 commit into
mainfrom
feat/agent-id

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • uipath init mints a stable id (GUID) into uipath.json, preserved across re-init and backfilled for existing projects
  • uipath pack sources the package projectId from uipath.json#id, validating it is a GUID (and failing otherwise), falling back to the legacy .telemetry.json ProjectKey / SW project id
  • llmops spans, trace baggage, and eval telemetry resolve the agent id through one source: uipath.json#id first, then the legacy env vars (UIPATH_AGENT_ID / UIPATH_PROJECT_ID / PROJECT_KEY) for already-deployed agents; a non-GUID id is ignored so it can never reject span ingestion
  • uipath init no longer writes .uipath/.telemetry.json; an existing one is still honored for the id and telemetry attribution
  • the id field is documented in uipath.schema.json / uipath.spec.md
  • allow langchain-cross tests to run against 'uncompatible' libraries from PR (similar to ci: force local wheels via uv override in cross-tests #1723)

Why

a coded agent or function needs one stable identifier that survives authoring, packaging, and runtime so traces and deployed releases correlate back to the same project. anchoring it in uipath.json decouples the id from telemetry being enabled, and routing spans, baggage and telemetry through a single resolver keeps them from diverging.

Development Packages

uipath

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath==2.11.0.dev1016956769",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath>=2.11.0.dev1016950000,<2.11.0.dev1016960000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }
uipath-platform = { index = "testpypi" }

[tool.uv]
override-dependencies = ["uipath-platform==0.1.67.dev1016956769"]

uipath-platform

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath-platform==0.1.67.dev1016956769",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath-platform>=0.1.67.dev1016950000,<0.1.67.dev1016960000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-platform = { index = "testpypi" }

Copilot AI review requested due to automatic review settings May 29, 2026 16:00
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels May 29, 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 introduces a stable agentId stored in uipath.json and wires it through project initialization, packaging (operate.json projectId), and LLMOps span attributes to enable consistent correlation across authoring, packaging, and runtime.

Changes:

  • Add agentId to the uipath.json schema and mint/backfill it during uipath init (preserving existing values).
  • Update uipath pack to source operate.json#projectId from uipath.json#agentId, with fallback to legacy .uipath/.telemetry.json ProjectKey.
  • Update span attribute resolution to prefer cached uipath.json#agentId, falling back to PROJECT_KEY, and add/adjust tests accordingly.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/uipath/src/uipath/_cli/models/uipath_json_schema.py Adds agentId field to the typed uipath.json configuration model.
packages/uipath/src/uipath/_cli/cli_init.py Mints/backfills agentId into uipath.json during uipath init.
packages/uipath/src/uipath/_cli/_utils/_project_files.py Introduces resolve_existing_project_id() to reuse Studio Web/env or legacy telemetry ProjectKey.
packages/uipath/src/uipath/_cli/cli_pack.py Switches packaging to use agentId as projectId and removes old inline telemetry lookup.
packages/uipath/tests/cli/test_init.py Adds coverage for minting/backfilling/preserving agentId across init scenarios.
packages/uipath/tests/cli/test_pack.py Adds coverage for projectId sourcing from agentId and legacy telemetry fallback.
packages/uipath-platform/src/uipath/platform/common/_span_utils.py Adds cached read of agentId from uipath.json and uses it for span agentId.
packages/uipath-platform/tests/services/test_span_utils.py Adds tests for agentId resolution priority and caching behavior; clears cache between tests.
packages/uipath/pyproject.toml Bumps uipath version.
packages/uipath/uv.lock Updates lockfile metadata / versions.
packages/uipath-platform/pyproject.toml Bumps uipath-platform version.
packages/uipath-platform/uv.lock Updates lockfile metadata / versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/uipath/src/uipath/_cli/cli_pack.py Outdated
Comment thread packages/uipath/src/uipath/_cli/cli_pack.py Outdated
@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 2 times, most recently from 3f97eac to c5bb52b Compare June 2, 2026 12:12

@RobinMennens-UiPath RobinMennens-UiPath 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.

Took a pass focused on the agentId behavior across the coded agent types, regressions, and the spans. Two things I'd like to align on before this goes in:

For plain functions and declarative agents this is end-to-end correct. But langgraph/llamaindex agents build their own operate.json in the plugin repos and won't source projectId from uipath.json#agentId until we mirror this there. Is there a follow-up tracking that, or is the expectation that those plugins start reading uipath.json#agentId?

Separately, on alignment with the vertical-solutions-check-agent-id.yml check: that check looks for a coded agent's ID only in .uipath/.telemetry.json#ProjectKey or .uipath/local-project-id.json#projectId — not in uipath.json#agentId. With telemetry disabled, create_telemetry_config_file doesn't write .telemetry.json, and we don't write local-project-id.json either, so an agent inited by this PR would have its ID only in uipath.json and the CI check would report it as missing. Are we updating that check to read uipath.json#agentId too, or should init also write one of the files it expects? These two need to agree.

Comment thread packages/uipath-platform/src/uipath/platform/common/_span_utils.py Outdated
Comment thread packages/uipath-platform/src/uipath/platform/common/_span_utils.py Outdated
Comment thread packages/uipath/src/uipath/_cli/cli_init.py Outdated
@radu-mocanu

Copy link
Copy Markdown
Collaborator Author

But langgraph/llamaindex agents build their own operate.json in the plugin repos and won't source projectId from uipath.json#agentId

This is not true.
All UiPath Coded Agents are using the same packager. No changes are needed in the integration repos.

@radu-mocanu

radu-mocanu commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

Separately, on alignment with the vertical-solutions-check-agent-id.yml check

This is not a concern for the coded agents SDK. the changes are backwards compatible, meaning that existing IDs will still be honored. newly created agents will indeed drop telemetry.json file. Any consumer (like that gh action) need to be updated to reflect the new behaviour -> uipath.json as the source of truth.

@alexandra-c alexandra-c 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.

Could we extend this to cover function project types as well? agentId isn't the right name for a coded function, could we detect the project type and use functionId accordingly, or pick a generic name that works for both?

@RobinMennens-UiPath

Copy link
Copy Markdown
Contributor

Could we extend this to cover function project types as well? agentId isn't the right name for a coded function, could we detect the project type and use functionId accordingly, or pick a generic name that works for both?

If you ask me, everything that can run on the UiPath platform should have a unique GUID identifier that never changes. RPA, coded functions, coded agents, low code agents, etc.
ProjectId kind of already seems a generic candidate for that.. but agentId already got introduced as a special ID just for agents.
We either keep introducing special IDs such as functionId, or we try to limit the number of IDs we have and stick to a generic ProjectId or something similar
CC @JosephMar

@radu-mocanu

Copy link
Copy Markdown
Collaborator Author

We either keep introducing special IDs such as functionId, or we try to limit the number of IDs we have and stick to a generic ProjectId or something similar

Agreed. the problem is that we already have a ProjectKey (similar to project id, that is the release key from orchestrator). to be consistent with the agentId naming (which is already the established field for low code agents today) I would use functionId for functions. I will also consult with the team regarding this since it would be a spec decision

@JosephMar

Copy link
Copy Markdown
Member

We either keep introducing special IDs such as functionId, or we try to limit the number of IDs we have and stick to a generic ProjectId or something similar

Agreed. the problem is that we already have a ProjectKey (similar to project id, that is the release key from orchestrator). to be consistent with the agentId naming (which is already the established field for low code agents today) I would use functionId for functions. I will also consult with the team regarding this since it would be a spec decision

IMO every product should define its own GUID (I imagine you'll need this exposed downstream at some point). For Agents we are exposing a concrete AgentIId which must be separate from ProjectId (because of flow) so the generic approach might not work well unless you also include a discriminator, but at that point having separate IDs is probably similar overhead

@jepadil23 FYI this is similar to what we are solving for Trace service ID hierarchy

@jepadil23 jepadil23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

idea LGTM, only resolve if possible build issues

@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 2 times, most recently from ffd3ad1 to f357f13 Compare June 12, 2026 10:34
@radu-mocanu radu-mocanu added the build:dev Create a dev build from the pr label Jun 12, 2026
@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 4 times, most recently from d84609f to ec87297 Compare June 16, 2026 06:33
@radu-mocanu

radu-mocanu commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Settled on uipath.json#Id for both agents and functions. Updated also the spec docs.

@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 4 times, most recently from 30469bd to 0edb08d Compare June 16, 2026 09:43
@radu-mocanu radu-mocanu changed the title feat: add stable agentId to uipath.json for packaging and spans feat: add stable id to uipath.json for packaging and spans Jun 16, 2026
@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 2 times, most recently from 6d4a5dc to c21b7d5 Compare June 16, 2026 10:24
@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 6 times, most recently from 0a663e9 to 7d0b509 Compare June 16, 2026 14:36
@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 →

@radu-mocanu radu-mocanu force-pushed the feat/agent-id branch 3 times, most recently from 1daff88 to 7d80dec Compare June 16, 2026 15:35
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu radu-mocanu merged commit ed5e509 into main Jun 16, 2026
164 of 165 checks passed
@radu-mocanu radu-mocanu deleted the feat/agent-id branch June 16, 2026 16:42
@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 →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr 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.

8 participants