Refactor platform headers; rename captured-headers metadata key#65
Merged
cosminacho merged 2 commits intomainfrom Apr 17, 2026
Merged
Refactor platform headers; rename captured-headers metadata key#65cosminacho merged 2 commits intomainfrom
cosminacho merged 2 commits intomainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromuipath.platform.common.constantsinstead of hardcoded strings. Constants are lowercase (x-uipath-processkeyetc.) — HTTP header names are case-insensitive, so wire behavior is unchanged.UIPATH_PROCESS_KEYis URL-encoded withurllib.parse.quote(process_key, safe=\"\")before being placed in theX-UiPath-ProcessKeyheader, matching the platform-wide convention.X-UiPath-LicensingContextis now populated dynamically fromUiPathConfig.licensing_contextwhen set. Read at call time so updates are picked up without rebuilding settings.process_key,job_key,folder_key,trace_id,agenthub_config,organization_id,tenant_id) remainpydantic.Field(validation_alias=...). Onlylicensing_context— which comes fromUiPathConfig, not an env var — is read at header-build time.Langchain
AIMessage.response_metadataunder theheaderskey (previouslyuipath_llmgateway_headers). Update any consumers that read this key.Packages affected
uipath-llm-client1.9.1 → 1.9.2 (platform settings refactor)uipath-langchain-client1.9.1 → 1.9.2 (metadata key rename; min core dep bumped to 1.9.2)Test plan
ruff check && ruff formatpyrightpytest tests(1515 passed, 736 skipped, 9 xpassed)\"path/with+special=chars\"→\"path%2Fwith%2Bspecial%3Dchars\".🤖 Generated with Claude Code