Repository navigation
fix(openai_agents): preserve interrupted workflow spans - #20846
yshapiro-57 wants to merge 1 commit into
Conversation
Stamp workflow kind when OpenAI Agents traces start so prematurely finished spans remain valid LLM Observability events. Co-authored-by: Cursor <cursoragent@cursor.com>
Codeowners resolved asResolved from the full PR diff against |
Circular import analysis
|
Dependency direction analysis
|
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🔗 Commit SHA: f3522d6 | Docs | View more details | Give us feedback! |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3522d6878
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return | ||
|
|
||
| self._integration.trace(oai_trace=OaiTraceAdapter(trace), submit_to_llmobs=True) | ||
| self._integration.trace(oai_trace=OaiTraceAdapter(trace), submit_to_llmobs=True, kind="workflow") |
There was a problem hiding this comment.
Update the start-time kind guidance
This establishes a new lifecycle requirement—workflow spans must stamp their kind at trace start so interrupted traces can still be exported—but .claude/skills/llmobs-integrations/references/implementation-guide.md still limits its start-time contract to kind="agent" spans. Leaving that reference unchanged means future integrations following the repository guidance can reproduce the same missing-kind drop for workflows; extend the guidance to cover this pattern.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Human Summary
While working on https://github.com/ddoghq/dd-source/pull/120671 I found that the automated evals that are supposed to verify that the new skill is actually working are sporadically producing this error message:
I asked Codex and it came up with a theory that this is because our OpenAI Agents integration is setting
kind="workflow"on the agent workflow spans only inon_trace_endand not inon_trace_start. If the code throws an exception beforeon_trace_endis called, then a span without akindwill be emitted, triggering this error. Codex's suggested fix was to redundantly setkind="workflow"on these spans inon_trace_start.I am not familiar with the code myself and need to rely on
AI Summary
AI Verification
scripts/run-tests --venv 1373e84scripts/run-tests --venv 1373e84 -- tests/contrib/openai_agents/test_openai_agents_llmobs.py -k test_llmobs_workflow_kind_set_on_trace_startscripts/lint checksHuman Verification
Install
dd-trace-pyfrom local, rerun the tests from the linked PR in dd-source, and make sure the errors are gone.Made with Cursor