Skip to content

fix: Properly shutdown the context in the CLI - #710

Merged
allenporter merged 3 commits into
Python-roborock:mainfrom
allenporter:cli-harden
Dec 29, 2025
Merged

fix: Properly shutdown the context in the CLI#710
allenporter merged 3 commits into
Python-roborock:mainfrom
allenporter:cli-harden

Conversation

@allenporter

@allenporterallenporter commented Dec 27, 2025

Copy link
Copy Markdown
Contributor

This avoids leaving open a session after running commands and properly catches exceptions in the CLI commands.

Pulled out from #709

This avoids leaving open a session after running commands and properly catches exceptions in the CLI commands.
CopilotAI review requested due to automatic review settings December 27, 2025 15:59

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to properly shutdown the context in the CLI and improve exception handling by adding try-except-finally blocks to the async_command decorator. The changes ensure that resources are cleaned up after running commands and that exceptions are properly caught and logged.

Key Changes:

  • Added exception handling with try-except-finally block in the async command decorator
  • Added logging for uncaught exceptions and error output to stderr
  • Added cleanup call in the finally block to ensure resources are released

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadroborock/cli.py Outdated
Comment threadroborock/cli.py Outdated
Comment threadroborock/cli.py Outdated
@allenporter
allenporter merged commit bf31b9b into Python-roborock:mainDec 29, 2025
7 checks passed
Sign up for freeto 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.

3 participants

@allenporter@Lash-L