Skip to content

Support new TaskSpanData and TurnSpanData from openai-agents 0.14#1888

Open
alexmojaki wants to merge 23 commits intomainfrom
add-openai-agents-task-turn-span-data
Open

Support new TaskSpanData and TurnSpanData from openai-agents 0.14#1888
alexmojaki wants to merge 23 commits intomainfrom
add-openai-agents-task-turn-span-data

Conversation

@alexmojaki
Copy link
Copy Markdown
Collaborator

Stacked on top of #1887.

Adds message templates for the new `TaskSpanData` and `TurnSpanData` span types introduced in openai-agents 0.14, and flattens the nested `data` attribute they expose so the templates can use `{name}`, `{turn}`, and `{agent_name}` directly.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 28, 2026

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7643cdb
Status: ✅  Deploy successful!
Preview URL: https://0e9d7174.logfire-docs.pages.dev
Branch Preview URL: https://add-openai-agents-task-turn.logfire-docs.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Base automatically changed from update-deps-2026-04-28 to main April 28, 2026 13:54
Importing agents.sandbox triggers DynamicCompactionPolicy class definition
inside pytest.importorskip's catch_warnings block, silencing the
protected-namespace UserWarning on pydantic <2.10. The subsequent
'from agents import ...' no longer fires it because the class is already
cached in sys.modules. This lets us drop the global warning filter.
Matches the surrounding pragma usage on the TranscriptionSpanData and
SpeechSpanData branches above.
…test

conftest.py imports from openai-agents during setup, which on pydantic <2.10
triggers the DynamicCompactionPolicy protected-namespace UserWarning. With
filterwarnings=error in pyproject.toml that aborts test collection. Wrapping
the import in warnings.catch_warnings() silences it without needing a global
filter.
Comment thread tests/conftest.py Outdated
Comment thread tests/otel_integrations/test_openai_agents.py Outdated
devin-ai-integration[bot]

This comment was marked as resolved.

TaskSpanData and TurnSpanData (used in logfire/_internal/integrations/openai_agents.py)
were introduced in openai-agents 0.14, so the existing >=0.9.0 floor was misleading.
The lock file already pinned 0.14.3 and CI tested against that — this just makes the
constraint match reality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant