Files
SubMiner/backlog/tasks/task-324 - Fix-mpv-playlist-changes-re-running-app-warmups.md
T
sudacode a9c3a5e679 Preserve overlay across macOS flaps and mpv playlist changes
- keep visible overlays alive during transient macOS tracker loss
- reuse the running mpv overlay path on playlist navigation
- update regression coverage and changelog fragments
2026-05-04 00:06:27 -07:00

2.6 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority
id title status assignee created_date updated_date labels dependencies references priority
TASK-324 Fix mpv playlist changes re-running app warmups Done
2026-05-03 07:48 2026-05-03 07:52
bug
mpv
overlay
launcher/
src/core/services/mpv.ts
src/main/runtime/
medium

Description

When moving to the next or previous mpv playlist entry, SubMiner should reconnect the existing app/runtime to mpv instead of treating the new video like a fresh app startup. Re-running startup warmups or creating another app session after the first video can interfere with overlay behavior.

Acceptance Criteria

  • #1 Changing to next or previous mpv playlist item reuses the existing app/runtime instead of launching a new app session.
  • #2 Startup warmups are not repeated for playlist item changes after the first app startup.
  • #3 Overlay behavior remains available after playlist navigation.
  • #4 Regression test covers the playlist-change/reconnect path.

Implementation Plan

  1. Reproduce the plugin auto-start regression with a failing Lua start-gate test.
  2. Update mpv plugin auto-start handling so playlist/file changes with an already-running overlay reuse the existing app path and do not re-arm pause-until-ready warmup.
  3. Add changelog fragment and run plugin/launcher verification.

Implementation Notes

RED: lua scripts/test-plugin-start-gate.lua failed after changing the duplicate pause-until-ready auto-start expectations; it showed the loading gate was armed twice while overlay was already running.

GREEN: plugin/subminer/process.lua now disarms any old ready gate and only reasserts visible overlay state when auto-start fires while state.overlay_running is already true.

Final Summary

Summary:

  • Updated the mpv Lua plugin auto-start reuse path so a file/playlist load with an already-running overlay no longer re-arms the pause-until-ready tokenization gate.
  • Kept the existing app/control command reuse behavior: subsequent auto-starts reassert visible/hidden overlay state without issuing another --start subprocess.
  • Added a changelog fragment for the mpv playlist overlay reuse fix.

Tests:

  • lua scripts/test-plugin-start-gate.lua (red before fix, green after)
  • bun run test:plugin:src
  • bun run changelog:lint
  • bun run test:launcher:env:src