Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

troubleshoot issues around wait_while_speaking #121

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Sep 23, 2024

added logs to debug issues around wait_while_speaking

add support for old ovos-workshop version containing a bug that sends a bool instead of an int OpenVoiceOS/OVOS-workshop#238

Summary by CodeRabbit

  • New Features

    • Enhanced session management with improved timeout handling and logging for audio output states.
  • Bug Fixes

    • Added warnings for invalid timeout parameters and session states to prevent method execution errors.

Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes in the SessionManager class's wait_while_speaking method improve the handling of the timeout parameter, ensuring it defaults to 15 seconds if provided as a boolean. The method now includes logging for various states, such as when the session is not speaking and when waiting for audio output to end. Additionally, warnings are logged for timeouts, enhancing the clarity of the session's behavior during audio processing.

Changes

File Change Summary
ovos_bus_client/session.py Updated wait_while_speaking method to handle timeout as Union[int, bool], added logging for session states, and included warnings for timeouts and non-speaking states.

Poem

In the burrow, where whispers play,
A timeout's warning saves the day.
When silence reigns and sessions pause,
We hop with joy, for now, we cause
The logs to sing, the states to cheer,
In our cozy home, all's bright and clear! 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 893a5b1 and 3be36e0.

Files selected for processing (1)
  • ovos_bus_client/session.py (1 hunks)
Additional comments not posted (6)
ovos_bus_client/session.py (6)

629-632: Improved error handling for timeout parameter

Good addition of a check for boolean timeout values. This prevents potential issues with incorrect parameter types and provides a helpful warning message.


640-641: Added warning for non-speaking session

Excellent addition of a warning log when attempting to wait on a session that is not currently speaking. This helps identify potential misuse of the method.


645-645: Enhanced logging for waiting state

Good addition of a debug log to indicate when the method starts waiting for audio output to end. This improves visibility into the method's execution flow.


653-653: Improved logging for audio output end

Nice addition of a debug log to indicate when the audio output has ended for a specific session. This helps track the completion of the waiting period.


658-659: Added timeout warning

Good addition of a warning log when waiting for audio output end times out. This helps identify potential issues with long-running audio output.


629-659: Overall improvements to wait_while_speaking method

The changes made to the wait_while_speaking method significantly enhance its robustness and debuggability. The additions include:

  1. Improved error handling for the timeout parameter.
  2. Better logging at various stages of the method's execution.
  3. Clear warnings for potential misuse or timeout situations.

These improvements align well with the PR objectives of troubleshooting issues around the wait_while_speaking function. The enhanced logging will greatly assist in identifying and resolving any problems that may occur during the waiting process.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JarbasAl JarbasAl marked this pull request as ready for review September 23, 2024 16:52
@JarbasAl JarbasAl added the fix label Sep 23, 2024
@JarbasAl JarbasAl merged commit df9b286 into dev Sep 23, 2024
8 checks passed
@JarbasAl JarbasAl deleted the troubleshoot branch September 23, 2024 16:56
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.

1 participant