feat: add trace URL in workflow runs

This commit is contained in:
Abhishek Kumar 2026-01-03 17:59:59 +05:30
parent 085a88308a
commit cdf68533ad
5 changed files with 55 additions and 20 deletions

View file

@ -109,6 +109,13 @@ def register_task_event_handler(
gathered_context = await engine.get_gathered_context()
# Add trace URL if available (must be done before conversation tracing ends)
if task.turn_trace_observer:
trace_url = task.turn_trace_observer.get_trace_url()
if trace_url:
gathered_context["trace_url"] = trace_url
logger.debug(f"Added trace URL to gathered_context: {trace_url}")
# also consider existing gathered context in workflow_run
gathered_context = {**gathered_context, **workflow_run.gathered_context}