chore(weave): initial set up of the openai agents realtime API support.#6247
Open
chance-wnb wants to merge 1 commit intomasterfrom
Open
chore(weave): initial set up of the openai agents realtime API support.#6247chance-wnb wants to merge 1 commit intomasterfrom
chance-wnb wants to merge 1 commit intomasterfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=3a8fc39ecaf25ab809e37f01339d79e4d0d474b7 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
7b18203 to
92c09e3
Compare
This was referenced Mar 3, 2026
neutralino1
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds manual Weave tracing support for
@openai/agents-realtimeRealtimeSessionusage in the TypeScript SDK.Call
instrumentRealtimeSession(session)beforesession.connect()and Weave will automatically capture a structured call tree for the entire session:No changes to user application code are required beyond the single
instrumentRealtimeSessioncall. The adapter attaches/detaches cleanly and handles abrupt disconnects.The future PRs will implement the auto injection.
How it works
session.created,session.updated) is sourced fromsession.on('transport_event'), which proxies all raw server-sent WebSocket events.turn_started/turn_doneevents.turn_startedcarriesproviderData.response.id;turn_donecarries the full response object including token usage.audiochunk (keyed byresponseId) and closes onaudio_doneor when the parentturn_donefires, whichever comes first.connection_change: 'disconnected', which cleanly closes all open calls.@openai/agents-realtime— duck-typed interfaces (RealtimeSessionLike,RealtimeTransportLike) in a separate types file mean the integration works without adding the package as a required dependency.inputTokens/input_tokens, etc.) and stored under the session model name, matching theRecord<string, LLMUsageSchema>shape the Weave backend expects.Files changed
src/integrations/openai.realtime.agent.tsWeaveRealtimeTracingAdapterclass +instrumentRealtimeSession()factorysrc/integrations/openai.realtime.agent.types.tsRealtimeSessionLike/RealtimeTransportLikeinterfacessrc/integrations/index.tsinstrumentRealtimeSessionsrc/index.tsinstrumentRealtimeSessionfrom top-level packageUsage
Testing