Skip to content

Conversation

@dangusev
Copy link
Contributor

@dangusev dangusev commented Nov 13, 2025

  • Invoke logger configuration from cli_runner instead of the Agent
  • Configure only vision_agents logger, keep other loggers intact (must be at WARNING level by default)

Summary by CodeRabbit

  • Breaking Changes

    • Removed optional agent logging parameter.
    • Removed legacy example CLI helpers; replaced by a single streamlined CLI command set.
  • Refactor

    • Renamed logging configuration API for consistency.
    • Default log timestamp format now includes full date and time.
  • Updates

    • Reduced Deepgram plugin log severity for connection closures.
  • Tests

    • Updated tests to use the renamed logging API and adjusted agent initialization.

@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Walkthrough

Removed Agent-level logging setup and TurnEndedEvent subscription; renamed and centralized the SDK logging helper; refactored CLI runner to a launcher-based flow with a single Click command; adjusted logging formatter/propagation; updated tests and one Deepgram log call site.

Changes

Cohort / File(s) Summary
Agent initialization
agents-core/vision_agents/core/agents/agents.py
Removed log_level parameter from Agent.__init__, deleted automatic logging configuration and TurnEndedEvent subscription, removed configure_default_logging import
CLI runner refactor
agents-core/vision_agents/core/cli/cli_runner.py
Removed run_example/example_cli; added single cli with run_agent Click command; launcher-based launch/join flow; centralized logging via configure_sdk_logger; asyncio logger level save/restore and shutdown handling
Logging utilities
agents-core/vision_agents/core/utils/logging.py
Renamed configure_default_loggingconfigure_sdk_logger; removed GETSTREAM_LOGGER; updated formatter date format; set propagate=False and only set logger level when NOTSET; only configure main logger
Plugin logging
plugins/deepgram/vision_agents/plugins/deepgram/deepgram_stt.py
Lowered _on_close log level from warning to debug
Tests
tests/test_utils.py, tests/test_agent.py, tests/test_agent_tracks.py
Updated tests to call configure_sdk_logger; removed log_level=None from Agent constructor calls; simplified logging assertions

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant CLI as CLI Runner
    participant Launcher as AgentLauncher
    participant Agent as Agent
    participant Demo as Demo UI
    participant Join as join_call

    CLI->>Launcher: launch(call_type, call_id)
    Launcher-->>CLI: Agent instance
    alt demo enabled and edge supports demo
        CLI->>Agent: edge.open_demo_for_agent()
        Agent-->>Demo: open demo
    end
    alt join_call provided
        CLI->>Launcher: join_call(...)
        Join-->>CLI: result (sync or awaitable)
    else no join_call
        CLI-->>CLI: emit warning
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Check async vs sync handling and asyncio logger level save/restore in cli_runner.py.
  • Verify all import and call-site updates from configure_default_loggingconfigure_sdk_logger.
  • Confirm removal of log_level and TurnEndedEvent subscription in Agent.__init__ doesn't break other consumers or tests.

Possibly related PRs

Suggested labels

cli, tests

Suggested reviewers

  • d3xvn
  • tschellenbach

Poem

The wiring quiets — a small black clock unwinds,
the logger sheds its fur and learns to sleep;
a launch opens like a throat of late bright winds,
demo doors glimpse light where old irons keep.
We prune the names; the dark becomes less deep.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% 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 'Logging clean up' directly aligns with the main objective of the PR, which is to clean up logging configuration by removing log_level parameters from Agent, renaming configure_default_logging to configure_sdk_logger, and consolidating logger configuration into cli_runner.
✨ 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/logging-cleanup-v2

📜 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 cf64182 and e6701ce.

📒 Files selected for processing (1)
  • agents-core/vision_agents/core/agents/agents.py (0 hunks)
💤 Files with no reviewable changes (1)
  • agents-core/vision_agents/core/agents/agents.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 / Ruff & mypy

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

@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: 0

🧹 Nitpick comments (1)
agents-core/vision_agents/core/utils/logging.py (1)

21-22: Refresh the docstring to match current behavior

The docstring still promises both the “vision_agents” and “getstream” loggers, but the implementation now configures only “vision_agents”. Please update the wording so it reflects the actual behavior.

Apply this diff to fix the docstring:

-    """
-    Sets the default configuration for "vision_agents" and "getstream" loggers to have a nice formatting
-    if it's not already configured.
-    """
+    """
+    Sets the default configuration for the "vision_agents" logger with a nice formatter
+    if it's not already configured.
+    """
📜 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 03f97ec and 647edc8.

📒 Files selected for processing (5)
  • agents-core/vision_agents/core/agents/agents.py (0 hunks)
  • agents-core/vision_agents/core/cli/cli_runner.py (3 hunks)
  • agents-core/vision_agents/core/utils/logging.py (2 hunks)
  • plugins/deepgram/vision_agents/plugins/deepgram/deepgram_stt.py (1 hunks)
  • tests/test_utils.py (2 hunks)
💤 Files with no reviewable changes (1)
  • agents-core/vision_agents/core/agents/agents.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-13T22:00:34.300Z
Learnt from: dangusev
Repo: GetStream/Vision-Agents PR: 98
File: plugins/deepgram/vision_agents/plugins/deepgram/stt.py:135-150
Timestamp: 2025-10-13T22:00:34.300Z
Learning: In the Deepgram STT plugin (plugins/deepgram/vision_agents/plugins/deepgram/stt.py), the `started()` method is designed to wait for the connection attempt to complete, not to guarantee a successful connection. It's acceptable for the connection attempt to fail, and downstream code handles the case where `self.dg_connection` is `None`. The `_connected_once` event is set in the `finally` block intentionally to signal attempt completion.

Applied to files:

  • plugins/deepgram/vision_agents/plugins/deepgram/deepgram_stt.py
🧬 Code graph analysis (2)
tests/test_utils.py (1)
agents-core/vision_agents/core/utils/logging.py (1)
  • configure_sdk_logger (19-46)
agents-core/vision_agents/core/cli/cli_runner.py (3)
agents-core/vision_agents/core/utils/logging.py (1)
  • configure_sdk_logger (19-46)
agents-core/vision_agents/core/agents/agent_launcher.py (2)
  • AgentLauncher (18-125)
  • launch (111-125)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (1)
  • open_demo_for_agent (354-360)
⏰ 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 / Ruff & mypy
🔇 Additional comments (1)
plugins/deepgram/vision_agents/plugins/deepgram/deepgram_stt.py (1)

256-256: Let me check one more detail about how the error parameter is used and whether there's conditional logging elsewhere in the codebase:

Based on the verification, this change is acceptable. The logging level reduction aligns with the PR's objective to reduce verbosity while maintaining error visibility through separate error handling.


No action required. The logging change is reasonable.

The Deepgram SDK uses separate EventType.CLOSE and EventType.ERROR handlers, with _on_error already logging at ERROR level and raising exceptions. The code in _on_close only clears the connection state flag; downstream code in process_audio already logs a warning when the connection closes during active processing.

Downgrading to DEBUG is appropriate because:

  • Unexpected errors are captured by the separate _on_error handler
  • Clean connection closures are normal operational events
  • The connection state is properly managed and any disruption during message processing is already logged

@Nash0x7E2 Nash0x7E2 merged commit 0250c39 into main Nov 13, 2025
6 checks passed
@Nash0x7E2 Nash0x7E2 deleted the chore/logging-cleanup-v2 branch November 13, 2025 17:27
@coderabbitai coderabbitai bot mentioned this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants