Skip to content

feat: default agenthub_config to codedagentsplayground at design time - #125

Draft
al3xanndru wants to merge 2 commits into
mainfrom
feat/coded-agents-playground-agenthub-config
Draft

feat: default agenthub_config to codedagentsplayground at design time#125
al3xanndru wants to merge 2 commits into
mainfrom
feat/coded-agents-playground-agenthub-config

Conversation

@al3xanndru

Copy link
Copy Markdown
Contributor

What & why

Makes coded agents meter their design-time LLM calls as CodedAgents.Playground instead of AgentHub.LLM. PlatformBaseSettings.agenthub_config now defaults to codedagentsplayground for design-time runs (local, Studio Web, or a debug session) instead of None; a deployed run keeps it None → gateway resolves to AgentHub.LLM (unchanged).

Because every coded chat/embedding client resolves settings through PlatformSettings and coded user code constructs clients directly (bypassing the factory), the env-bridge/default is the single place that covers all execution modes and all three frameworks (langchain / llamaindex / openai-agents) without per-framework code.

How

PlatformBaseSettings gains an after-validator (settings/platform/settings.py):

if self.agenthub_config is None and not _is_deployed_execution():
    self.agenthub_config = AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND  # "codedagentsplayground"

_is_deployed_execution() = UiPathConfig.job_key and not is_studio_project and not is_rooted_to_debug_job. Value matches AgentHubService AgentHubConfigValues.CodedAgentsPlayground.

Mode → result:

Mode Signals agenthub_config
Local run / dev no job key codedagentsplayground
Studio Web (debug) job key + UIPATH_PROJECT_ID codedagentsplayground
Debug session (Maestro) isDebug codedagentsplayground
Deployed job key, no project, no debug NoneAgentHub.LLM

Precedence / non-interference

  • Explicit wins: low-code agents and evaluators call get_chat_model(agenthub_config=...), which overrides via model_copy (does not re-run this validator). So low-code (agentsplayground/agentsruntime) and eval (agentsevals) are unaffected.
  • Env wins: an explicit UIPATH_AGENTHUB_CONFIG still takes precedence over the computed default.
  • An explicit empty string stays an opt-out (validator only fires on None).

Scope / behavior change (intentional)

This changes the default for all directly-constructed platform LLM clients: a non-deployed process (e.g. a plain local UiPathChat() script) now sends codedagentsplayground and draws the playground pool. Deployed processes are unchanged. This is the accepted trade-off for a single-repo, all-modes solution. Minor version bump (1.17.1 → 1.18.0) on both packages with changelogs.

Tests

Updated tests/core/features/settings/test_platform.py: deployed → header omitted; design-time → codedagentsplayground; Studio Web → design-time; explicit env override wins. (Pre-existing llmgateway- parametrized errors in test_factory_function.py are environmental — missing LLMGW_* env — and independent of this change.)

Downstream follow-up (separate repos)

  • uipath-langchain-python: tests/chat/test_agenthub_config_default.py::test_default_is_none asserts the old None default and must be updated when it bumps to uipath-llm-client >= 1.18.0. Same for the other framework repos when they bump.

Related

  • AgentHubService #1618 (FF gate → CodedAgents.Playground sends costUsd).
  • gitops #551167 (alpha codedagents_playground.json draws the pool at real cost).

🤖 Generated with Claude Code

PlatformBaseSettings.agenthub_config now defaults to "codedagentsplayground"
for design-time runs (local, Studio Web, or a debug session) instead of None,
so directly-constructed coded-agent chat/embedding clients draw the
CodedAgents.Playground licensing pool. A deployed run — a real Orchestrator job
that is neither a Studio Web project nor rooted to a debug session — keeps
agenthub_config None, which the gateway resolves to AgentHub.LLM (unchanged).

The value is computed only when no explicit agenthub_config is supplied
(UIPATH_AGENTHUB_CONFIG unset). Callers that pass an explicit value — low-code
agents and evaluators via get_chat_model(agenthub_config=...) — override it via
model_copy (which does not re-run the validator) and are unaffected; an explicit
empty string stays an opt-out.

Bumps both packages to 1.18.0 with changelogs (core behavior change).

Pairs with AgentHubService #1618 and gitops #551167 (CodedAgents.Playground
real-cost metering).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the private _is_deployed_execution() copy (and the local
AGENTHUB_CONFIG_CODED_AGENTS_PLAYGROUND constant) with the shared
resolve_coded_agenthub_config() helper from uipath.platform, so the
langchain path and the other coded frameworks classify design-time vs
deployed identically. Behavior is unchanged.

Bumps the uipath-platform floor to >=0.2.18 (the release that adds the helper).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@al3xanndru

Copy link
Copy Markdown
Contributor Author

Refactored to consume the shared resolve_coded_agenthub_config() helper now added in uipath-python #1860 (uipath.platform.common), instead of the private _is_deployed_execution() copy. Same behavior; the design-time-vs-deployed logic now lives in one place for all coded frameworks.

New stacking: this now requires uipath-platform>=0.2.18 (floor bumped), so it's stacked on #1860 publishing. Merge order: #1860 → this → #1035. CI here is red / not locally runnable until 0.2.18 is on PyPI.

@al3xanndru
al3xanndru marked this pull request as draft August 13, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant