From 089244bc6e344b4bbedf33a3449a2dd1b3b19537 Mon Sep 17 00:00:00 2001 From: Runnan Jia Date: Wed, 17 Jun 2026 10:00:34 -0700 Subject: [PATCH] feat(platform): include jobKey in LLM Gateway trace baggage build_trace_context_headers emits folderKey/agentId/processKey but omits jobKey, even though UiPathConfig.job_key is available. LLM Gateway now builds the model-call span from this baggage, so without jobKey the span cannot be attributed to the originating job. Callers currently work around this by hand-injecting jobKey via extra_baggage; emitting it natively fixes it once for every caller. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/uipath/platform/chat/llm_trace_context.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py b/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py index b9c1f74a0..e1d21112e 100644 --- a/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py +++ b/packages/uipath-platform/src/uipath/platform/chat/llm_trace_context.py @@ -44,6 +44,8 @@ def build_trace_context_headers( baggage_parts.append(f"agentId={agent_id}") if process_key := UiPathConfig.process_key: baggage_parts.append(f"processKey={process_key}") + if job_key := UiPathConfig.job_key: + baggage_parts.append(f"jobKey={job_key}") if baggage_parts: headers["x-uipath-tracebaggage"] = ",".join(baggage_parts)