Skip to content

Refactor platform headers; rename captured-headers metadata key#65

Merged
cosminacho merged 2 commits intomainfrom
feat/platform-headers-refactor
Apr 17, 2026
Merged

Refactor platform headers; rename captured-headers metadata key#65
cosminacho merged 2 commits intomainfrom
feat/platform-headers-refactor

Conversation

@cosminacho
Copy link
Copy Markdown
Collaborator

Summary

Three related changes, all confined to platform-settings + the langchain response-metadata surface:

Platform settings

  • PlatformBaseSettings.build_auth_headers() now uses the shared header-name constants from uipath.platform.common.constants instead of hardcoded strings. Constants are lowercase (x-uipath-processkey etc.) — HTTP header names are case-insensitive, so wire behavior is unchanged.
  • UIPATH_PROCESS_KEY is URL-encoded with urllib.parse.quote(process_key, safe=\"\") before being placed in the X-UiPath-ProcessKey header, matching the platform-wide convention.
  • X-UiPath-LicensingContext is now populated dynamically from UiPathConfig.licensing_context when set. Read at call time so updates are picked up without rebuilding settings.
  • Pydantic-settings pattern preserved: all env-var-backed fields (process_key, job_key, folder_key, trace_id, agenthub_config, organization_id, tenant_id) remain pydantic.Field(validation_alias=...). Only licensing_context — which comes from UiPathConfig, not an env var — is read at header-build time.

Langchain

  • Breaking: captured LLM Gateway headers are exposed on AIMessage.response_metadata under the headers key (previously uipath_llmgateway_headers). Update any consumers that read this key.

Packages affected

  • uipath-llm-client 1.9.1 → 1.9.2 (platform settings refactor)
  • uipath-langchain-client 1.9.1 → 1.9.2 (metadata key rename; min core dep bumped to 1.9.2)

Test plan

🤖 Generated with Claude Code

Platform settings now build auth/routing headers using the shared
constants in uipath.platform.common.constants (lowercase canonical
form; HTTP is case-insensitive so no wire change). Process key is
URL-encoded (quote(..., safe="")) before being sent, matching the
platform-wide convention, and licensing_context is read dynamically
from UiPathConfig at call time so updates are picked up without
rebuilding settings.

Langchain: captured gateway headers are now exposed on
AIMessage.response_metadata under the "headers" key (previously
"uipath_llmgateway_headers"). Breaking for anyone reading that key.

Core 1.9.1 -> 1.9.2. Langchain 1.9.1 -> 1.9.2 (requires core >= 1.9.2).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace hardcoded env-var string literals with the corresponding
ENV_* constants from uipath.platform.common.constants. Keeps the
pydantic-settings pattern but removes the duplication between
uipath-llm-client and the platform library. UIPATH_REFRESH_TOKEN
and UIPATH_AGENTHUB_CONFIG stay as literals since the platform
library does not export constants for them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cosminacho cosminacho deployed to LLMGW_SETTINGS April 17, 2026 13:21 — with GitHub Actions Active
@cosminacho cosminacho merged commit f5a09a9 into main Apr 17, 2026
8 checks passed
@cosminacho cosminacho deleted the feat/platform-headers-refactor branch April 17, 2026 13:24
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