Skip to content

Conversation

@Nash0x7E2
Copy link
Member

@Nash0x7E2 Nash0x7E2 commented Oct 7, 2025

Summary by CodeRabbit

  • Chores

    • CI test workflow now injects environment variables for multiple third‑party integrations, aligning the test environment with production.
  • Tests

    • Reworked a realtime audio test to use a shared fixture for greater consistency and reduced flakiness.
    • Added synchronous waits in two integration tests to ensure event processing completes before assertions.

@Nash0x7E2 Nash0x7E2 self-assigned this Oct 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Walkthrough

Adds CI env variables to .github/workflows/run_tests.yml, refactors a realtime test to use the shared realtime fixture instead of realtime2, and adds synchronous waits for event processing in two XAI integration tests to wait for llm.events. No other behavior changes.

Changes

Cohort / File(s) Summary
CI workflow env vars
\.github/workflows/run_tests.yml
Adds an env block to the test job wiring multiple GitHub Secrets into the CI environment: ANTHROPIC_API_KEY, CARTESIA_API_KEY, DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, FAL_KEY, GOOGLE_API_KEY, OPENAI_API_KEY, OPENAI_MODEL, STREAM_API_KEY, STREAM_API_SECRET, XAI_API_KEY. No other steps or control flow changed.
Realtime test fixture refactor
plugins/gemini/tests/test_gemini_realtime.py
Updates test_audio_sending_flow signature to accept and use the existing realtime fixture (was realtime2), replacing all realtime2 references with realtime. No behavioral change beyond fixture reuse.
XAI tests: wait for event processing
plugins/xai/tests/test_xai_llm.py
Adds synchronous waits for llm.events in two integration tests (test_memory and test_native_memory) after sending responses to ensure event processing completes before continuing. No other test logic changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant GH as GitHub Actions
  participant WF as run_tests.yml Job
  participant Sec as GitHub Secrets
  participant Env as Job Env
  participant TR as Test Runner

  Dev->>GH: Push / PR
  GH->>WF: Start test workflow
  WF->>Sec: Read required secrets
  Sec-->>WF: Secret values
  WF->>Env: Populate env (API keys, model)
  note right of Env #D3E4CD: Newly added env variables
  WF->>TR: Run tests
  TR-->>GH: Report results
Loading
sequenceDiagram
  autonumber
  participant Test as Test
  participant Realtime as Realtime Fixture
  participant LLM as LLM (events)

  Test->>Realtime: use fixture for audio flow
  Realtime-->>Test: send/receive responses
  Test->>LLM: send simple/create response
  note right of LLM #FDEBD0: New explicit wait added
  Test->>LLM: wait for llm.events
  LLM-->>Test: events processed
  Test-->>Test: continue assertions
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

In the cool belly of CI I taste keys like tin,
secret fruit threaded through a breathless machine.
One fixture slides into another's quiet,
and the waiting—small, deliberate—collects like ash.
Tests keep their white rooms and the lamps go on.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 succinctly conveys the primary change of adding CI secrets to the workflow configuration, directly reflecting the main modification in the pull request without extraneous detail.
✨ 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 chore/ci-env

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01dcf20 and 26bb4dc.

📒 Files selected for processing (1)
  • plugins/xai/tests/test_xai_llm.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

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

**/*.py: Never adjust sys.path (e.g., sys.path.append/insert/assignment)
Docstrings must follow the Google style guide

Files:

  • plugins/xai/tests/test_xai_llm.py
🧬 Code graph analysis (1)
plugins/xai/tests/test_xai_llm.py (1)
agents-core/vision_agents/core/events/manager.py (1)
  • wait (406-417)
⏰ 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). (6)
  • GitHub Check: integration / Test "integration"
  • GitHub Check: integration / Ruff & mypy
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Ruff & mypy
  • GitHub Check: unit / Ruff & mypy
  • GitHub Check: unit / Test "not integration"
🔇 Additional comments (2)
plugins/xai/tests/test_xai_llm.py (2)

81-81: LGTM! Synchronization ensures proper memory context.

The wait ensures the first message's events are fully processed before sending the follow-up question, which is essential for testing conversation memory.


94-94: LGTM! Synchronization ensures proper memory context.

Consistent with line 81, this wait ensures the first message's events are fully processed before testing memory retention.


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

Copy link

@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

📥 Commits

Reviewing files that changed from the base of the PR and between 3739605 and c5395ec.

📒 Files selected for processing (1)
  • .github/workflows/run_tests.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/run_tests.yml

32-32: property "anthropic_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


33-33: property "cartesia_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


34-34: property "deepgram_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


35-35: property "elevenlabs_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


36-36: property "fal_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


37-37: property "google_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


38-38: property "openai_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


39-39: property "openai_model" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


40-40: property "stream_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


41-41: property "stream_api_secret" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


42-42: property "xai_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)

⏰ 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). (4)
  • GitHub Check: integration / Test "integration"
  • GitHub Check: integration / Ruff & mypy
  • GitHub Check: unit / Ruff & mypy
  • GitHub Check: unit / Ruff & mypy

Comment on lines +31 to +42
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
FAL_KEY: ${{ secrets.FAL_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Declare the required secrets for this reusable workflow.

Because workflow_call currently exposes no secrets (secrets: {}), every ${{ secrets.* }} reference here resolves to an empty string at runtime. The CI job will therefore boot without the keys you expect, and any step needing them will fail (actionlint is already flagging this). Define the secrets under on.workflow_call.secrets (or set secrets: inherit) so callers can pass them through.

 on:
   workflow_call:
-    inputs:
-      marker:
-        description: 'pytest -m expression (e.g., `not integration` or `integration`)'
-        required: true
-        type: string
-    secrets: {}
+    inputs:
+      marker:
+        description: 'pytest -m expression (e.g., `not integration` or `integration`)'
+        required: true
+        type: string
+    secrets:
+      ANTHROPIC_API_KEY:
+        required: true
+      CARTESIA_API_KEY:
+        required: true
+      DEEPGRAM_API_KEY:
+        required: true
+      ELEVENLABS_API_KEY:
+        required: true
+      FAL_KEY:
+        required: true
+      GOOGLE_API_KEY:
+        required: true
+      OPENAI_API_KEY:
+        required: true
+      OPENAI_MODEL:
+        required: true
+      STREAM_API_KEY:
+        required: true
+      STREAM_API_SECRET:
+        required: true
+      XAI_API_KEY:
+        required: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
FAL_KEY: ${{ secrets.FAL_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
on:
workflow_call:
inputs:
marker:
description: 'pytest -m expression (e.g., `not integration` or `integration`)'
required: true
type: string
secrets:
ANTHROPIC_API_KEY:
required: true
CARTESIA_API_KEY:
required: true
DEEPGRAM_API_KEY:
required: true
ELEVENLABS_API_KEY:
required: true
FAL_KEY:
required: true
GOOGLE_API_KEY:
required: true
OPENAI_API_KEY:
required: true
OPENAI_MODEL:
required: true
STREAM_API_KEY:
required: true
STREAM_API_SECRET:
required: true
XAI_API_KEY:
required: true
🧰 Tools
🪛 actionlint (1.7.7)

32-32: property "anthropic_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


33-33: property "cartesia_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


34-34: property "deepgram_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


35-35: property "elevenlabs_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


36-36: property "fal_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


37-37: property "google_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


38-38: property "openai_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


39-39: property "openai_model" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


40-40: property "stream_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


41-41: property "stream_api_secret" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)


42-42: property "xai_api_key" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string}

(expression)

🤖 Prompt for AI Agents
.github/workflows/run_tests.yml around lines 31-42: the workflow references
multiple secrets via `${{ secrets.* }}` but `workflow_call` currently exposes no
secrets so those values are empty at runtime; update the reusable workflow to
declare each secret under `on.workflow_call.secrets` (or set `secrets: inherit`)
so callers can pass them through — add entries for ANTHROPIC_API_KEY,
CARTESIA_API_KEY, DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, FAL_KEY, GOOGLE_API_KEY,
OPENAI_API_KEY, OPENAI_MODEL, STREAM_API_KEY, STREAM_API_SECRET, XAI_API_KEY,
and ensure callers supply the secrets when invoking the workflow.

@Nash0x7E2 Nash0x7E2 merged commit b6deb4d into main Oct 8, 2025
6 of 7 checks passed
Nash0x7E2 added a commit that referenced this pull request Oct 8, 2025
commit 4757845
Merge: 8d9a9e2 c834231
Author: Thierry Schellenbach <[email protected]>
Date:   Wed Oct 8 10:29:01 2025 +0200

    Merge branch 'main' of github.com:GetStream/agents

commit 8d9a9e2
Author: Thierry Schellenbach <[email protected]>
Date:   Wed Oct 8 10:28:54 2025 +0200

    move fal smart detection to plugin

commit c834231
Merge: b6deb4d facedf2
Author: maxkahan <[email protected]>
Date:   Wed Oct 8 10:17:22 2025 +0200

    Merge pull request #73 from GetStream/fix/shared_forwarder

    fix: video feed mismatch and VideoForwarder resource leaks

commit b6deb4d
Author: Neevash Ramdial (Nash) <[email protected]>
Date:   Wed Oct 8 09:38:51 2025 +0200

    Add CI secrets  (#72)

    * Add in secrets for daily integration

    * Rename to realtime instead of realtime 2

    * Add events.wait to xAI test

commit 73ddc8e
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 17:27:40 2025 +0200

    pyproject cleanup

commit facedf2
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 17:26:11 2025 +0200

    fix: critical video feed mismatch and VideoForwarder resource leaks

    CRITICAL FIXES:

    1. Video Feed Mismatch (LLM getting wrong video)
       - When YOLO/video processors are used, LLM was receiving empty processed track
       - Root cause: shared_forwarder was created from RAW track but LLM was given processed track
       - Fix: Create separate forwarders for raw and processed video tracks
       - Now LLM correctly receives YOLO-annotated frames when using pose detection

    2. VideoForwarder Resource Leaks
       - Consumer tasks were never removed from _tasks set (memory leak)
       - Fix: Add task.add_done_callback(self._task_done) to clean up tasks
       - Producer exceptions were silently swallowed
       - Fix: Log and re-raise exceptions for proper error handling

    3. Race Condition in VideoForwarder.stop()
       - Used list() snapshot for cancellation but original set for gather()
       - Fix: Use tasks_snapshot consistently throughout stop()

    4. Multiple start() Protection
       - No guard against calling start() multiple times
       - Fix: Add _started flag and early return with warning

    5. Missing VideoForwarder Cleanup in Agent
       - Forwarders were created but never stopped on agent.close()
       - Fix: Track all forwarders and stop them in close() method

    These fixes prevent resource leaks, ensure correct video routing, and improve
    error visibility for production debugging.

commit fbc1759
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 17:19:45 2025 +0200

    wip on pyproject files

commit 3739605
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 15:55:19 2025 +0200

    pypi environment

commit 6144265
Merge: 231efc8 9b5db80
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 15:17:09 2025 +0200

    cleanup

commit 231efc8
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 15:12:31 2025 +0200

    remove duplicate publish tracks

commit 9b5db80
Merge: 2d08f1d 4f60ab2
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 14:40:31 2025 +0200

    Merge pull request #71 from GetStream/fix/agents-tracks

    fix: remove duplicate track publishing code

commit 2d08f1d
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 14:30:01 2025 +0200

    fix openai realtime test

commit 4f60ab2
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 14:25:01 2025 +0200

    fix: remove duplicate track publishing code and initialize error counters

    - Remove duplicate track publishing and audio/video listening code in join() method
    - Initialize timeout_errors and consecutive_errors before video processing loop
    - Increment timeout_errors in TimeoutError exception handler
    - Fixes potential crash when error counters are referenced but not initialized

commit ca562de
Merge: 4b8f686 b121bc6
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 14:24:02 2025 +0200

    Merge branch 'main' of github.com:GetStream/agents

commit 4b8f686
Author: Thierry Schellenbach <[email protected]>
Date:   Tue Oct 7 14:23:54 2025 +0200

    nicer tests for openai realtime

commit b121bc6
Merge: 4a178e9 1bd131b
Author: Yarik <[email protected]>
Date:   Tue Oct 7 14:22:56 2025 +0200

    Merge pull request #69 from GetStream/yarikrudenok/ai-176-migrate-branding-to-vision-agents

    Refactor project structure to replace 'stream_agents' with 'vision_ag…

commit 1bd131b
Author: Yarik <[email protected]>
Date:   Tue Oct 7 14:16:49 2025 +0200

    feat: [AI-176] Rename to vision

commit 4a178e9
Merge: a940bd3 2eacdfb
Author: maxkahan <[email protected]>
Date:   Tue Oct 7 11:50:28 2025 +0100

    Merge pull request #70 from GetStream/fix/agent-example

    fix: Agent Example and TURN detection

commit 2eacdfb
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 12:42:58 2025 +0200

    Fix: Remove f-string prefix from log with no placeholders

    - Fixed lint error F541 on line 797
    - Changed f-string to regular string since no interpolation needed

commit 66deea5
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 12:41:33 2025 +0200

    Move realtime mode check to top of _on_turn_event

    - Realtime LLMs handle their own turn detection and interruption
    - Skip all turn event processing in realtime mode (not just LLM triggering)
    - Removes duplicate realtime check in TurnEndedEvent branch
    - Cleaner and more efficient

commit 8c01c31
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 12:20:42 2025 +0200

    Optimize: Check realtime mode early in _on_turn_event TurnEndedEvent

    - Add early return for realtime mode after logging the event
    - Skips unnecessary transcript fetching and participant metadata extraction
    - Removes redundant realtime_mode check later in the flow
    - Consistent with _on_transcript optimization

commit f4fa0a5
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 12:18:09 2025 +0200

    Optimize: Check realtime mode early in _on_transcript

    - Add early return if in realtime mode to skip LLM triggering logic
    - In realtime mode, the LLM handles STT, turn detection, and responses itself
    - Removes redundant check in else branch
    - Improves code clarity and efficiency

commit 12b1638
Author: Deven Joshi <[email protected]>
Date:   Tue Oct 7 10:48:07 2025 +0200

    Fix agent LLM triggering and turn detection

    - Implement automatic LLM triggering in _on_transcript() for both modes:
      * Without turn detection: triggers immediately on transcript completion
      * With turn detection: accumulates transcripts and waits for TurnEndedEvent
    - Add _pending_user_transcripts dict to track multi-chunk transcripts per user
    - Implement turn detection LLM response in _on_turn_event()
    - Add TTS interruption when user starts speaking (barge-in)
    - Fix FAL turn detection event emission logic
    - Fix double TTS triggering in OpenAI LLM plugin (was emitting LLMResponseCompletedEvent twice)
    - Add FAL turn detection to simple agent example
    - Update example dependencies to use vision-agents naming

    Known limitation: LLM response generation is not yet cancelled when user interrupts.
    Only TTS audio playback stops, but LLM continues generating in background.
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.

2 participants