[PR #2189] [MERGED] Fix Spotify DJ parity playback #5460

Closed
opened 2026-10-22 04:16:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2189
Author: @Xelvanis
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/spotify-dj-parity


📝 Commits (4)

  • 9afdcc1 Fix Spotify DJ parity playback
  • 905cfca Refresh Spotify DJ parity checks
  • 8a87225 Address Spotify DJ review findings
  • dc236ef Mark Spotify fallback playback failures

📊 Changes

7 files changed (+860 additions, -97 deletions)

View changed files

📝 src-tauri/src/commands/storage/integrations/spotify.rs (+686 -76)
📝 src/engine/agents-runtime/executor/agent-executor.ts (+121 -8)
📝 src/engine/contracts/constants/agent-prompts.ts (+1 -1)
📝 src/engine/generation/agent-runner.ts (+44 -11)
📝 src/engine/generation/start-generation.ts (+2 -0)
📝 src/engine/generation/tools-runtime.ts (+2 -0)
📝 src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx (+4 -1)

📄 Description

Linked issue

Closes https://github.com/Pasta-Devs/Marinara-Engine/issues/2167

Why this change

  • Spotify DJ could fail or drift from user expectations in several parity paths: playlist indexing used an invalid Spotify page size, cached playlist candidates could survive reconnects, and Spotify agent playback could be skipped or bypass chat tool gating in retry paths.

What changed

  • Added indexed Spotify source candidate selection for Liked Songs and configured playlists with valid Spotify paging and compact scored candidate responses.
  • Isolated and evicted Spotify track-index cache entries when the connected account changes or disconnects.
  • Restored chat-level tool gating for agent tools while keeping Spotify's built-in tool defaults available when allowed.
  • Added Spotify playback fallback/confirmation behavior so returned play actions actually call spotify_play, and game-mode Spotify picks request track repeat.
  • Updated Spotify DJ prompt/runtime constraints for manual retries and no-active-playback cases.

Refactor impact

Primary owner:

Rust Spotify integration and engine generation/agent runtime.

Impact areas reviewed:

  • Spotify auth/token reconnect and disconnect flow
  • Spotify playlist/Liked Songs candidate retrieval
  • Spotify playback command response shape and repeat handling
  • Agent tool context gating and allowed-tool enforcement
  • Shared chat settings behavior for Spotify agent default tools

Boundary notes:

  • Product orchestration remains in src/engine.
  • Spotify API/device/token behavior remains in src-tauri.
  • Feature UI only updates agent setting defaults and does not add raw Tauri calls.
  • Remote-capable command routing was not expanded.

Pressure points touched:

  • Shared chat settings drawer was touched only for built-in Spotify agent tool defaults.
  • No ModeSurface, GameSurface, src-tauri/src/lib.rs registration, or import module changes.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm check passed locally.
  • Native Spotify/Tauri playback with a real Spotify account/device still needs manual verification.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix for existing Spotify DJ behavior; no new discoverable surface was added.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs or release-note changes were made because this fixes existing Spotify DJ runtime behavior without changing contributor guidance or adding a new user-discoverable feature.

UI evidence

No screenshots; no visible layout change. Native Spotify playback still needs manual account/device QA.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2189 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/spotify-dj-parity` --- ### 📝 Commits (4) - [`9afdcc1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9afdcc194de334ef231b959d56ed2fcefa70453a) Fix Spotify DJ parity playback - [`905cfca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/905cfca633c206408204da0378a77b22bc221052) Refresh Spotify DJ parity checks - [`8a87225`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a872259b1542bea0776508696912588cef0ab02) Address Spotify DJ review findings - [`dc236ef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dc236efc0d7be0e6d63fdf01fb6ba4fb8423ecf7) Mark Spotify fallback playback failures ### 📊 Changes **7 files changed** (+860 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/integrations/spotify.rs` (+686 -76) 📝 `src/engine/agents-runtime/executor/agent-executor.ts` (+121 -8) 📝 `src/engine/contracts/constants/agent-prompts.ts` (+1 -1) 📝 `src/engine/generation/agent-runner.ts` (+44 -11) 📝 `src/engine/generation/start-generation.ts` (+2 -0) 📝 `src/engine/generation/tools-runtime.ts` (+2 -0) 📝 `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx` (+4 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep validation checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes https://github.com/Pasta-Devs/Marinara-Engine/issues/2167 ## Why this change - Spotify DJ could fail or drift from user expectations in several parity paths: playlist indexing used an invalid Spotify page size, cached playlist candidates could survive reconnects, and Spotify agent playback could be skipped or bypass chat tool gating in retry paths. ## What changed - Added indexed Spotify source candidate selection for Liked Songs and configured playlists with valid Spotify paging and compact scored candidate responses. - Isolated and evicted Spotify track-index cache entries when the connected account changes or disconnects. - Restored chat-level tool gating for agent tools while keeping Spotify's built-in tool defaults available when allowed. - Added Spotify playback fallback/confirmation behavior so returned play actions actually call `spotify_play`, and game-mode Spotify picks request track repeat. - Updated Spotify DJ prompt/runtime constraints for manual retries and no-active-playback cases. ## Refactor impact Primary owner: Rust Spotify integration and engine generation/agent runtime. Impact areas reviewed: - Spotify auth/token reconnect and disconnect flow - Spotify playlist/Liked Songs candidate retrieval - Spotify playback command response shape and repeat handling - Agent tool context gating and allowed-tool enforcement - Shared chat settings behavior for Spotify agent default tools Boundary notes: - Product orchestration remains in `src/engine`. - Spotify API/device/token behavior remains in `src-tauri`. - Feature UI only updates agent setting defaults and does not add raw Tauri calls. - Remote-capable command routing was not expanded. Pressure points touched: - Shared chat settings drawer was touched only for built-in Spotify agent tool defaults. - No `ModeSurface`, `GameSurface`, `src-tauri/src/lib.rs` registration, or import module changes. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm check` passed locally. - Native Spotify/Tauri playback with a real Spotify account/device still needs manual verification. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix for existing Spotify DJ behavior; no new discoverable surface was added. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or release-note changes were made because this fixes existing Spotify DJ runtime behavior without changing contributor guidance or adding a new user-discoverable feature. ## UI evidence No screenshots; no visible layout change. Native Spotify playback still needs manual account/device QA. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:30 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5460
No description provided.