Skip to content

feat(platform): add resolve_coded_agenthub_config() shared helper - #1860

Draft
al3xanndru wants to merge 1 commit into
mainfrom
feat/coded-agenthub-config-resolver
Draft

feat(platform): add resolve_coded_agenthub_config() shared helper#1860
al3xanndru wants to merge 1 commit into
mainfrom
feat/coded-agenthub-config-resolver

Conversation

@al3xanndru

Copy link
Copy Markdown

What

Adds a single, shared helper in uipath-platform that classifies a coded-agent run as design-time vs deployed, so every coded framework (langchain / llamaindex / openai-agents) sends the same x-uipath-agenthub-config value instead of duplicating the logic.

from uipath.platform.common import resolve_coded_agenthub_config

resolve_coded_agenthub_config()  # "codedagentsplayground" at design time, None when deployed
  • Design-time (local, Studio Web, or a debug session) → "codedagentsplayground" → LLM calls draw the CodedAgents.Playground pool.
  • Deployed (a real Orchestrator job that is not a Studio Web project and not rooted to a debug session) → None → gateway resolves to AgentHub.LLM.

Logic (over UiPathConfig):

deployed = job_key present AND not is_studio_project AND not is_rooted_to_debug_job
Mode job_key is_studio_project is_rooted_to_debug_job result
Local run / dev codedagentsplayground
Studio Web debug (✓) codedagentsplayground
Debug-rooted job (Maestro) codedagentsplayground
Deployed None (AgentHub.LLM)

Change

  • common/_config.py: resolve_coded_agenthub_config().
  • constants/__init__.py: AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND = "codedagentsplayground" (matches AgentHubService AgentHubConfigValues.CodedAgentsPlayground).
  • Exported from uipath.platform.common.
  • uipath-platform 0.2.17 → 0.2.18.
  • Tests: 4 cases (local / deployed / Studio Web / debug-rooted) — all green; ruff + mypy clean.

Consumers (follow-ups)

  • uipath-llm-client-python Docs/core sdk 74 #125 refactors its private _is_deployed_execution() copy to import this helper (LangGraph path).
  • uipath-openai-agents and uipath-llamaindex (uipath-integrations-python) will call it and inject the x-uipath-agenthub-config header.

Part of the coded-agent → CodedAgents.Playground metering work (AgentHubService #1618, gitops #551167).

🤖 Generated with Claude Code

Add a single source of truth for classifying a coded-agent run as design-time
vs deployed, so all coded frameworks (langchain / llamaindex / openai-agents)
send the same x-uipath-agenthub-config value.

resolve_coded_agenthub_config() returns "codedagentsplayground" for design-time
runs (local, Studio Web, or a debug session) so LLM calls draw the
CodedAgents.Playground pool, and None for a deployed run (a real Orchestrator job
that is neither a Studio Web project nor rooted to a debug session) -> AgentHub.LLM.

Adds the AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND constant and exports the helper
from uipath.platform.common. Bumps uipath-platform 0.2.17 -> 0.2.18.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 13, 2026 09:02
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Aug 13, 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

Adds a shared helper to uipath-platform to consistently classify coded-agent executions as design-time vs deployed and return the appropriate x-uipath-agenthub-config header value, reducing duplicated logic across downstream coded-agent frameworks.

Changes:

  • Introduces resolve_coded_agenthub_config() in uipath.platform.common to return "codedagentsplayground" for design-time runs and None for deployed runs.
  • Adds AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND constant and expands tests to cover local/deployed/Studio Web/debug-rooted scenarios.
  • Bumps uipath-platform version 0.2.17 → 0.2.18 and updates lockfile accordingly.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/uipath-platform/src/uipath/platform/common/_config.py Adds resolve_coded_agenthub_config() helper implementing the design-time vs deployed classification.
packages/uipath-platform/src/uipath/platform/common/init.py Re-exports the new helper from uipath.platform.common.
packages/uipath-platform/src/uipath/platform/constants/init.py Adds the codedagentsplayground AgentHub config constant for header usage.
packages/uipath-platform/tests/common/test_config_env_vars.py Adds unit tests covering the helper’s behavior across 4 execution modes.
packages/uipath-platform/pyproject.toml Bumps package version to 0.2.18.
packages/uipath-platform/uv.lock Updates lock metadata/version entry consistent with the release bump.

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

Comment on lines +52 to +54
# Value for HEADER_AGENTHUB_CONFIG that maps to the CodedAgents.Playground licensing
# operation code (matches AgentHubService AgentHubConfigValues.CodedAgentsPlayground).
AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND = "codedagentsplayground"
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants