Commit b8144c7
fix(temporal): disable OpenAI Agents SDK trace exporter under Temporal workers
The OpenAI Agents SDK registers a process-global BackendSpanExporter that POSTs
spans to api.openai.com/v1/traces. Under Temporal the run's trace context does
not survive the workflow->activity hop, so spans created in activities have no
active trace and are emitted as NoOpSpans (trace_id="no-op"). The exporter then
rejects every turn with 400 "Invalid 'data[0].trace_id': 'no-op'", flooding
worker logs and running a failing background export thread.
Agentex never uses this exporter — it has its own SGP tracing pipeline
(AsyncTracer / SGPTracingProcessor), wholly separate from the OpenAI SDK trace
provider. Disable it whenever an OpenAIAgentsPlugin is present.
Must be the OPENAI_AGENTS_DISABLE_TRACING env var, not agents.set_tracing_disabled():
the plugin installs a fresh TemporalTraceProvider at startup whose `_disabled`
is re-read from that env var in __init__, so a prior set_tracing_disabled() call
is discarded (verified). setdefault preserves an explicit operator override.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 35fc4b8 commit b8144c7
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
| |||
0 commit comments