Repository navigation
fix(openai_agents): isolate concurrent workflow state - #20870
yshapiro-57 wants to merge 1 commit into
Conversation
Codeowners resolved asResolved from the full PR diff against |
Circular import analysis
|
Dependency direction analysis
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Workflow metadata creation, lookup, and cleanup consistently use the OpenAI trace ID, keeping concurrent workflows independent when they share an APM trace.
🤖 Bits Code Review · Commit 62b2428
Human Summary
This is intended to fix the following errors in the SDK:
I had initially put up a different PR for this, #20846. Both PRs are agent-coded. @Yun-Kim pointed out that this other PR fixes the symptom but not the root cause of the following problem:
AI Summary
This fixes cross-talk between concurrent OpenAI Agents workflows that execute within the same APM trace. Workflow lifecycle bookkeeping now follows each OpenAI Agents trace identity, keeping LLM Observability metadata isolated through completion. Regression coverage exercises two concurrent agent runs under one traced operation.
AI Verification
scripts/run-tests --venv 213dcfe -- tests/contrib/openai_agents/test_openai_agents_llmobs.py -k test_llmobs_concurrent_agents_in_same_apm_tracescripts/run-tests -s --venv 213dcfescripts/lint typing -- ddtrace/contrib/internal/openai_agents/processor.py ddtrace/llmobs/_integrations/openai_agents.pyscripts/lint checksHuman Verification
I have installed dd-trace-py from local and confirmed that the "missing span kind" error still happens for me on trunk, but no longer happens on this branch.
Made with Cursor