Skip to content

Commit e89d23f

Browse files
smflorentinoclaude
andcommitted
fix: apply debug licensing override in openai-agents and pydantic-ai
Use shared apply_debug_licensing_override from uipath-platform to override the X-UiPath-AgentHub-Config header when rooted to a debug job (e.g. Maestro solution debug). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0f63b4e commit e89d23f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

  • packages
    • uipath-openai-agents/src/uipath_openai_agents/chat
    • uipath-pydantic-ai/src/uipath_pydantic_ai/chat

packages/uipath-openai-agents/src/uipath_openai_agents/chat/openai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import httpx
77
from openai import AsyncOpenAI, OpenAI
88
from uipath._utils._ssl_context import get_httpx_client_kwargs
9+
from uipath.platform.common import apply_debug_licensing_override
910
from uipath.utils import EndpointManager
1011

1112
from .supported_models import OpenAIModels
@@ -189,7 +190,9 @@ def _build_headers(self) -> dict[str, str]:
189190

190191
# Add optional headers
191192
if self._agenthub_config:
192-
headers["X-UiPath-AgentHub-Config"] = self._agenthub_config
193+
headers["X-UiPath-AgentHub-Config"] = apply_debug_licensing_override(
194+
self._agenthub_config
195+
)
193196
if self._byo_connection_id:
194197
headers["X-UiPath-LlmGateway-ByoIsConnectionId"] = self._byo_connection_id
195198
if job_key := os.getenv("UIPATH_JOB_KEY"):

packages/uipath-pydantic-ai/src/uipath_pydantic_ai/chat/openai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pydantic_ai.models.openai import OpenAIChatModel
99
from pydantic_ai.providers.openai import OpenAIProvider
1010
from uipath._utils._ssl_context import get_httpx_client_kwargs
11+
from uipath.platform.common import apply_debug_licensing_override
1112
from uipath.utils import EndpointManager
1213

1314
from .supported_models import OpenAIModels
@@ -187,7 +188,9 @@ def _build_headers(self) -> dict[str, str]:
187188

188189
# Add optional headers
189190
if self._agenthub_config:
190-
headers["X-UiPath-AgentHub-Config"] = self._agenthub_config
191+
headers["X-UiPath-AgentHub-Config"] = apply_debug_licensing_override(
192+
self._agenthub_config
193+
)
191194
if self._byo_connection_id:
192195
headers["X-UiPath-LlmGateway-ByoIsConnectionId"] = self._byo_connection_id
193196
if job_key := os.getenv("UIPATH_JOB_KEY"):

0 commit comments

Comments
 (0)