Skip to content

Add child span handling to OpenAIAgentsTraceProcessor#1361

Closed
colinbennettbrain wants to merge 2 commits intomainfrom
OpenAIAgentsTraceProcessor
Closed

Add child span handling to OpenAIAgentsTraceProcessor#1361
colinbennettbrain wants to merge 2 commits intomainfrom
OpenAIAgentsTraceProcessor

Conversation

@colinbennettbrain
Copy link
Copy Markdown
Contributor

The fix updates OpenAIAgentsTraceProcessor.onTraceEnd() to end any child spans still tracked for the trace before deleting trace state, so spans don’t stay “in progress” if onTraceEnd runs before deferred onSpanEnd. It also adds regression tests covering the race path, late onSpanEnd no-op behavior, and multiple remaining child spans being closed correctly.

…ement logic to end any open child spans when a trace ends. This addresses a potential race condition between onTraceEnd and onSpanEnd.
Ensure pre-commit formatting checks pass in CI by applying canonical line-wrapping to updated assertions.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If this PR is still relevant, please leave a comment, push an update, or remove the stale label. Thank you for your contributions!

@lforst
Copy link
Copy Markdown
Member

superseded by #1813

Luca Forstner (lforst) added a commit that referenced this pull request Apr 14, 2026
Supersedes
#1361

Ends child spans of an openai agents trace before ending the root span -
making sure that all the spans in the trace are properly ended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants