Skip to content

feat(memory): send the run's executionType on memory search - #2035

Merged
yashwagle1 merged 2 commits into
mainfrom
feat/memory-search-execution-type
Dec 2, 2026
Merged

yashwagle1 merged 2 commits into
mainfrom
feat/memory-search-execution-type

Conversation

@yashwagle1

@yashwagle1 yashwagle1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

LLMOps is adding a count of how often deployed agent runs put each memory into their prompt, so users can see whether a memory is actually used in production. To count it, LLMOps has to know whether a memory search comes from a debug run or a deployed run. Today the search request carries nothing about the calling run.

  • resolve_execution_type() (uipath.platform.common) is one debug-vs-deployed value for a run, meant to be shared by memory search and agent spans. A run is Debug when any of these says so, and Runtime otherwise:

    • UIPATH_IS_DEBUG=true
    • Orchestrator's isDebug internal argument, which marks a debug job and every job started from it. A Maestro solution debug runs a deployed process with uipath run under such a job, so the CLI command alone would say runtime.
    • the CLI command: debug / dev (playground) or eval

    A signal can only turn a run into Debug.

  • MemorySearchRequest.execution_type (executionType on the wire) is optional. When the caller leaves it unset, MemoryService fills it from resolve_execution_type(). A value set by the caller is kept.

  • search and escalation_search move to the vNext route POST /llmopstenant_/api/Memory/{memorySpaceId}/search, the route that accepts executionType. They send memoryType 0 (episodic) or 1 (escalation). Response shapes are unchanged. escalation_ingest keeps its current route.

  • EscalationMemoryMatch parses answer from the JSON string LLMOps returns, including capitalized Output/Outcome keys. Before this, every escalation hit failed the response model, and callers had to fall back to parsing the raw payload.

  • Bumps uipath-platform to 0.3.23.

A follow-up in uipath-agents-python makes span executionType use the same resolve_execution_type(), so spans and memory usage label a run the same way. That PR needs this one released first.

How has this been tested?

  • tests/services/test_memory_service.py covers:
    • the vNext route for both searches, sync and async
    • memoryType per method
    • executionType defaulting to Runtime, becoming Debug under UIPATH_IS_DEBUG=true, and an explicit value being kept
    • escalation answers given as a JSON string, as an object, with capitalized keys, as None, and as invalid JSON (which still fails validation)
  • tests/common/test_resolve_execution_type.py covers each signal on its own: the env var in every case, isDebug true/false in uipath.json, and the playground / eval / runtime execution sources.
  • uv run pytest tests/services/test_memory_service.py tests/common: 175 passed. ruff check, ruff format --check and mypy src tests are clean.
  • Full uipath-platform suite: only two .ovpn attachment-MIME tests in test_span_utils.py fail locally. That code isn't touched here; Windows' registry maps .ovpn to an OpenVPN MIME type, so those tests fail on this machine only.

Are there any breaking changes?

  • None
  • Under Feature Flag
  • UiPath CLI Runtime changes

The old search routes stay up, so earlier SDK versions keep working. This version needs the LLMOps service to serve the vNext search route, which it already does. Usage counting starts once the LLMOps change that reads executionType is deployed; until then the field is ignored.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings December 1, 2026 20:19
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Dec 1, 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.

🟢 Approval recommended

No active review issues remain for the memory-search execution metadata changes.

No open issues 🎉

What changed in this PR

This PR adds run execution metadata to the UiPath Platform SDK’s memory searches, enabling LLMOps to distinguish debug usage from deployed usage when counting memory use.

Changes:

  • Adds a shared resolve_execution_type() helper and defaults search requests to the run’s execution type while preserving explicit values.
  • Moves episodic and escalation searches to the vNext endpoint and supports JSON-string escalation answers with capitalized keys.
  • Adds resolver and memory-service tests and bumps uipath-platform to 0.3.22.
File Description
packages/​uipath/​uv.lock Updates the platform dependency version to 0.3.22.
packages/​uipath-platform/​uv.lock Aligns the lockfile with version 0.3.22.
packages/​uipath-platform/​tests/​services/​test_memory_service.py Covers search routing, request metadata, and escalation answer parsing.
packages/​uipath-platform/​tests/​common/​test_resolve_execution_type.py Tests environment, job, and CLI execution-type signals.
packages/​uipath-platform/​src/​uipath/​platform/​memory/​memory.py Adds optional execution type and escalation answer parsing.
packages/​uipath-platform/​src/​uipath/​platform/​memory/​_memory_service.py Uses vNext search routes with memory and execution types.
packages/​uipath-platform/​src/​uipath/​platform/​constants/​__init__.py Defines the debug environment-variable constant.
packages/​uipath-platform/​src/​uipath/​platform/​common/​_config.py Implements shared debug-versus-runtime resolution.
packages/​uipath-platform/​src/​uipath/​platform/​common/​__init__.py Exports the execution-type resolver.
packages/​uipath-platform/​pyproject.toml Bumps the package version to 0.3.22.

Review effort: Balanced

@JosephMar JosephMar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this depend on backend changes? need to make sure the ship cadence aligns

@yashwagle1
yashwagle1 enabled auto-merge (squash) December 2, 2026 21:14
LLMOps counts how often deployed agent runs put each memory into their prompt,
so it needs to know whether a search comes from a debug or a deployed run.

- resolve_execution_type(): one debug-vs-deployed value for spans and memory.
  Debug when UIPATH_IS_DEBUG=true, when Orchestrator marks the job as debug
  (isDebug, inherited by every job a debug job starts, e.g. Maestro solution
  debug), or when the CLI runs debug/dev/eval; otherwise Runtime.
- MemorySearchRequest gains an optional execution_type; the service fills it
  from resolve_execution_type() when the caller leaves it unset.
- search and escalation_search move to the vNext route
  POST /llmopstenant_/api/Memory/{id}/search, the one that accepts
  executionType, sending memoryType 0 (episodic) or 1 (escalation).
- EscalationMemoryMatch parses the answer LLMOps returns as a JSON string
  (and its capitalized Output/Outcome keys), so escalation hits validate
  instead of failing the response model.
- Bump uipath-platform to 0.3.22.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yashwagle1
yashwagle1 force-pushed the feat/memory-search-execution-type branch from 906eb58 to f23019f Compare December 2, 2026 21:14
@yashwagle1
yashwagle1 disabled auto-merge December 2, 2026 21:14
0.3.22 was released from main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Dec 2, 2026

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 →

@yashwagle1
yashwagle1 merged commit 50a722a into main Dec 2, 2026
239 of 240 checks passed
@yashwagle1
yashwagle1 deleted the feat/memory-search-execution-type branch December 2, 2026 21:51
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants