File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,18 @@ async def run(
338
338
group_id = run_config .group_id ,
339
339
metadata = run_config .trace_metadata ,
340
340
disabled = run_config .tracing_disabled ,
341
- ):
341
+ ) as trace_ctx :
342
+ if trace_ctx .trace :
343
+ # Store run_config in trace context for access by sub-agents
344
+ # Prefer storing in metadata if available
345
+ if (
346
+ hasattr (trace_ctx .trace , "metadata" )
347
+ and isinstance (trace_ctx .trace .metadata , dict )
348
+ ):
349
+ trace_ctx .trace .metadata ["run_config" ] = run_config
350
+ else :
351
+ trace_ctx .trace ._run_config = run_config # type: ignore[attr-defined]
352
+
342
353
current_turn = 0
343
354
original_input : str | list [TResponseInputItem ] = copy .deepcopy (input )
344
355
generated_items : list [RunItem ] = []
You can’t perform that action at this time.
0 commit comments