Skip to content

fix: openai realtime participants and conversation sync#258

Merged
d3xvn merged 2 commits intomainfrom
fix/openai-transcript
Dec 12, 2025
Merged

fix: openai realtime participants and conversation sync#258
d3xvn merged 2 commits intomainfrom
fix/openai-transcript

Conversation

@d3xvn
Copy link
Copy Markdown
Contributor

@d3xvn d3xvn commented Dec 12, 2025

Summary by CodeRabbit

  • Refactor
    • Simplified participant tracking in the OpenAI realtime audio/voice flow to streamline handling of the active speaker; no public APIs changed and no user-facing behavior expected to change.

✏️ Tip: You can customize this high-level summary in your review settings.

@d3xvn d3xvn marked this pull request as draft December 12, 2025 11:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 12, 2025

Walkthrough

Replaced per-item participant mapping with a single _current_participant in the OpenAI realtime plugin; removed initialization and handling of _item_to_participant and _pending_participant, simplified conversation item creation and transcript handling to rely on the single current participant state. Tests referencing item-created mapping were removed.

Changes

Cohort / File(s) Summary
Realtime participant tracking
plugins/openai/vision_agents/plugins/openai/openai_realtime.py
Removed _item_to_participant and _pending_participant state and related handling; introduced use of a single _current_participant set in simple_audio_response; simplified conversation.item.created and transcription event logic to rely on _current_participant.
Tests updated
plugins/openai/tests/test_openai_realtime.py
Removed tests and test segments that simulated conversation.item.created mapping and the test_multi_user_participant_tracking case; simplified transcription-related test flow to match single-participant model.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect simple_audio_response to ensure _current_participant is always set before transcriptions are emitted.
  • Verify removal of per-item mapping doesn't regress concurrent/multi-user scenarios or introduce race conditions.
  • Run and review updated tests for coverage gaps around multi-user flows.

Possibly related PRs

Poem

I peel away the many names — the map, the thread —
One shadow left to speak into the bright machine.
The oldnotations rot like paperwork in rain;
A single voice, an inkless pulse, remains.
Quiet as a bone, the system learns to listen.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main changes: refactoring participant tracking from multi-user mapping to single current participant and simplifying conversation synchronization logic in the OpenAI realtime module.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/openai-transcript

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4d3ef and ee17bf7.

📒 Files selected for processing (1)
  • plugins/openai/tests/test_openai_realtime.py (0 hunks)
💤 Files with no reviewable changes (1)
  • plugins/openai/tests/test_openai_realtime.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Test "not integration"

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6ab5238 and 4b4d3ef.

📒 Files selected for processing (1)
  • plugins/openai/vision_agents/plugins/openai/openai_realtime.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/python.mdc)

**/*.py: Never adjust sys.path in Python code
Never write except Exception as e - use specific exception handling
Avoid using getattr, hasattr, delattr and setattr; prefer normal attribute access in Python
Docstrings should follow the Google style guide for docstrings

Files:

  • plugins/openai/vision_agents/plugins/openai/openai_realtime.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: dangusev
Repo: GetStream/Vision-Agents PR: 249
File: agents-core/vision_agents/core/agents/agents.py:1032-1042
Timestamp: 2025-12-10T19:35:30.572Z
Learning: In `agents-core/vision_agents/core/agents/agents.py`, when using `video_track_override_path`, creating a new `VideoFileTrack` for each participant (each call to `_on_track_added`) is intentional to maintain proper track lifecycle semantics tied to each participant.
🧬 Code graph analysis (1)
plugins/openai/vision_agents/plugins/openai/openai_realtime.py (2)
conftest.py (1)
  • participant (187-189)
agents-core/vision_agents/core/edge/sfu_events.py (10)
  • participant (1496-1501)
  • participant (1504-1507)
  • participant (1545-1550)
  • participant (1553-1556)
  • participant (1625-1630)
  • participant (1633-1636)
  • participant (2100-2105)
  • participant (2108-2111)
  • participant (2156-2161)
  • participant (2164-2167)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: unit / Test "not integration"

Comment thread plugins/openai/vision_agents/plugins/openai/openai_realtime.py
@dangusev dangusev marked this pull request as ready for review December 12, 2025 12:36
@d3xvn d3xvn merged commit a0042ea into main Dec 12, 2025
8 checks passed
@d3xvn d3xvn deleted the fix/openai-transcript branch December 12, 2025 12:46
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