Skip to content

fix: get_minicroft leaks MiniCroft on BaseException during boot - #134

Draft
JarbasAl wants to merge 1 commit into
devfrom
fix/basedexception-cleanup-on-boot
Draft

fix: get_minicroft leaks MiniCroft on BaseException during boot#134
JarbasAl wants to merge 1 commit into
devfrom
fix/basedexception-cleanup-on-boot

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Fable 5 (claude-fable-5) via Claude Code — NOT human-reviewed. Verify before acting.

get_minicroft() wraps croft.start() and the READY poll in except Exception: croft.stop(); raise. pytest-timeout's Failed exception and KeyboardInterrupt both derive from BaseException, not Exception, so either one raised while waiting for READY skips croft.stop() and leaks the started MiniCroft process (and its background threads) instead of being cleaned up.

Fix: catch BaseException instead of Exception in get_minicroft, so cleanup runs regardless of which exception type interrupts the boot, then re-raise as before.

Added a regression test (test_basedexception_during_boot_still_stops_croft in test/unittests/test_minicroft.py) that patches MiniCroft.start to raise KeyboardInterrupt and asserts MiniCroft.stop is called exactly once and the exception still propagates. Verified locally: the test fails against the pre-fix code (except Exception) and passes after changing it to except BaseException.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b97f60f0-890a-41f4-9767-168181ccbf6d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added the fix label Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Checking in! Here's how the automated tests are looking. 🧐

I've aggregated the results of the automated checks for this PR below.

🔍 Lint

Here's the lowdown on the latest automated check. 📉

ruff: issues found — see job log

📋 Repo Health

Scanning for any signs of code rot or decay. 🍄

✅ All required files present.

Latest Version: 1.6.6a1

ovoscope/version.py — Version file
README.md — README
LICENSE — License file
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
ovoscope/version.py has valid version block markers

🏷️ Release Preview

The release notes are being proofread by the gnomes. 🍄

Current: 1.6.6a1Next: 1.6.7a1

Signal Value
Label (none)
PR title fix: get_minicroft leaks MiniCroft on BaseException during boot
Bump build

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 1.6.7a1

Channel Status Note Current Constraint
Stable Not in channel -
Testing Too new (must be <1.0.0) ovoscope>=0.7.2,<1.0.0
Alpha Compatible ovoscope>=1.6.6a1

⚖️ License Check

Ensuring our EULA (if any) is still valid. 📑

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔒 Security (pip-audit)

I've checked the vulnerability database for hits. 🎯

✅ No known vulnerabilities found (79 packages scanned).

📊 Coverage

A deep dive into the sea of test results. 🌊

59.0% total coverage

⚠️ Some tests failed — coverage figures may be incomplete.

Files below 80% coverage (15 files)
File Coverage Missing lines
ovoscope/simple_listener.py 0.0% 63
ovoscope/tts_intelligibility.py 0.0% 200
ovoscope/version.py 0.0% 5
ovoscope/classic_listener.py 18.2% 117
ovoscope/intent_cases.py 21.4% 151
ovoscope/pytest_plugin.py 39.8% 237
ovoscope/cli.py 47.8% 132
ovoscope/ocp.py 47.9% 61
ovoscope/e2e.py 53.5% 66
ovoscope/media.py 57.0% 104
ovoscope/listener.py 57.1% 127
ovoscope/voice_loop.py 59.2% 118
ovoscope/audio.py 63.4% 126
ovoscope/__init__.py 64.3% 350
ovoscope/media_provider.py 67.6% 23

Full report: download the coverage-report artifact.

🔨 Build Tests

I've finished the digital carpentry on this PR. 🔨

Python Build Install Tests
3.10 ⚠️
3.11 ⚠️
3.12 ⚠️
3.13 ⚠️
3.14 ⚠️

❌ 3.10: Install OK, tests failed
❌ 3.11: Install OK, tests failed
❌ 3.12: Install OK, tests failed
❌ 3.13: Install OK, tests failed
❌ 3.14: Install OK, tests failed
Check job logs for details.


Providing clarity through automated analysis 🔍

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