Skip to content

fix: drop the tolerant playlist patch from the media harness - #146

Merged
JarbasAl merged 1 commit into
devfrom
fix/drop-tolerant-playlist
Aug 18, 2026
Merged

fix: drop the tolerant playlist patch from the media harness#146
JarbasAl merged 1 commit into
devfrom
fix/drop-tolerant-playlist

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.

OCPPlayerHarness.__enter__ patched ovos_media.player.Playlist with a local _TolerantPlaylist subclass that dropped bare-string positional args before calling the real Playlist.__init__. The comment explained the original intent: Playlist("Search Results") used to try to add the title string as a media entry, and the shim avoided that while still satisfying isinstance checks in player.py.

Against the currently published ovos-media (2.0.0a9, matching PyPI's latest release and the same restructure the defect report describes), the player's internal queue is its own PlayQueue object, built and mutated independently of the module-global Playlist name. Playlist(...) is never called by player.py to construct the queue, so the patch's only live effect left is rebinding the name that set_now_playing checks with isinstance(track, (MediaEntry, Playlist)). That means a caller who hands the harness a genuine ovos_utils.ocp.Playlist gets rejected with ValueError: Expected MediaEntry, but got: ..., because the object is an instance of the real class, not the harness's _TolerantPlaylist subclass sitting in the patched module slot. The shim had inverted from "compatibility helper" to "active mis-binding."

I deleted _TolerantPlaylist and its patch() call outright rather than making it conditional on the installed ovos-media version. ovoscope's media/dev extras pinned ovos-media>=0.0.2a3, a floor from before the 1.0/2.0 restructure that the harness code already assumes elsewhere (PlayQueue, the GUIInterface-presence check). That old pin was never actually exercised — nothing in the harness would work against pre-restructure ovos-media regardless of this patch — so I bumped both floors to 2.0.0a9, the version this repo genuinely supports, which makes "installed floor is already >=2.0.0a9" true and plain deletion correct.

I added TestOCPHarnessRealPlaylistIsinstance::test_real_playlist_passes_isinstance_in_set_now_playing, which drives a real Playlist through player.set_now_playing() inside the harness and asserts it lands correctly. I red-proved it by temporarily reinstating the old patch: the test fails with the ValueError described above, and passes again once the patch is gone.

Full test/ suite: before the change, 534 passed, 12 failed, 111 skipped; after, 535 passed (the one new test), 12 failed, 111 skipped — identical failure set both times. All 12 are pre-existing and unrelated to this patch: three are a BaseMediaService.__init__() got an unexpected keyword argument 'validate_source' mismatch between the harness's real-AudioService injection path and the installed ovos-media's constructor signature, and the other nine are test_listener_stream.py/test_audit_round1.py failures around microphone-plugin loading and dinkum-listener teardown, unrelated to media/Playlist. No test_tts_intelligibility ordering flake appeared in either run.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb9332c5-04b8-4132-8b53-921d8a7e290b


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 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

The automated sentinels have completed their watch. 💂‍♂️

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

📋 Repo Health

I've checked the repo's reflexes (aka build speed). ⚡

✅ All required files present.

Latest Version: 1.6.11a1

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

A look ahead at the next milestone. 🚩

Current: 1.6.11a1Next: 1.6.12a1

Signal Value
Label fix
PR title fix: drop the tolerant playlist patch from the media harness
Bump build

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 1.6.12a1

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.11a1

⚖️ License Check

The license report is filed and ready for review. 📁

✅ No license violations found.

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

🔍 Lint

Everything looks good so far! ✅

ruff: issues found — see job log

📊 Coverage

Let's see if we've left any dark corners in the test suite. 🔦

59.0% total coverage

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 22.3% 153
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 56.7% 101
ovoscope/listener.py 57.1% 127
ovoscope/voice_loop.py 59.0% 119
ovoscope/audio.py 63.4% 126
ovoscope/__init__.py 64.5% 353
ovoscope/media_provider.py 67.6% 23

Full report: download the coverage-report artifact.

🔨 Build Tests

Verifying the structural soundness of your build. 🏗️

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

🔒 Security (pip-audit)

Our digital defenses have been updated. 🛡️

✅ No known vulnerabilities found (79 packages scanned).


An automated hug for your code 🤗

@JarbasAl
JarbasAl force-pushed the fix/drop-tolerant-playlist branch from 5954bd9 to 9e58bcd Compare August 18, 2026 15:49
_TolerantPlaylist rebound ovos_media.player.Playlist to hide a bare-string
constructor arg quirk. Against current ovos-media (>=2.0.0a9) the player's
internal queue is its own PlayQueue, so the patch's only remaining effect is
making a genuine ovos_utils Playlist fail the module-global isinstance check
in set_now_playing. Delete the shim and bump the media/dev extras' ovos-media
floor to 2.0.0a9 (the pre-restructure 0.0.2a3 pin was stale and never
exercised by this harness code).

The same restructure dropped BaseMediaService's validate_source parameter —
session-source gating moved to the player's bus edge — so the harness's real-
backend injection path (OCPPlayerHarness.__enter__, ovoscope/media.py) drops
the stale kwarg too; nothing in the harness read AudioService.validate_source,
so there was no behavior to replace.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the fix/drop-tolerant-playlist branch from 9e58bcd to 60f95c9 Compare August 18, 2026 15:56
@JarbasAl
JarbasAl marked this pull request as ready for review August 18, 2026 16:21
@JarbasAl
JarbasAl merged commit e705de4 into dev Aug 18, 2026
13 of 14 checks passed
@JarbasAl
JarbasAl deleted the fix/drop-tolerant-playlist branch August 18, 2026 16:22
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