[PR #2566] [MERGED] fix(music-dj): don't bind Spotify tools to the YouTube-mode Music DJ #5661

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2566
Author: @Romuromylus
Created: 6/15/2026
Status: ✅ Merged
Merged: 6/15/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/music-dj-youtube-no-result


📝 Commits (3)

  • dafd8f7 fix(music-dj): don't bind Spotify tools to the YouTube-mode Music DJ
  • 364ddb4 Merge branch 'staging' into fix/music-dj-youtube-no-result
  • a72702d Merge branch 'staging' into fix/music-dj-youtube-no-result

📊 Changes

2 files changed (+11 additions, -2 deletions)

View changed files

📝 packages/server/src/routes/generate/retry-agents-route.ts (+3 -1)
📝 packages/server/src/services/generation/tool-resolution-runtime.ts (+8 -1)

📄 Description

Linked issue

Closes #2565

Why this change

  • After the Spotify and YouTube DJ agents were merged into the unified Music DJ agent, the Music DJ in YouTube mode stopped playing: it emitted no result and showed "No agents ran. Add tracker agents…". This restores YouTube Music DJ.

What changed

The Music DJ agent (type spotify) runs as a pure-JSON agent when musicProvider is "youtube" — it returns a search query and the client plays the result in the embedded player, so it has no tools by design. Two tool-binding paths backfilled the full Spotify tool set whenever a "spotify"-type agent had an empty enabledTools list, without checking the music provider, which turned the YouTube Music DJ into a tool-calling agent that never emitted a youtube_control result.

  • packages/server/src/routes/generate/retry-agents-route.ts: gate the empty-tools → all-Spotify-tools backfill on !musicAgentUsesYoutube(settings).
  • packages/server/src/services/generation/tool-resolution-runtime.ts: gate the equivalent backfill on musicProvider/musicPlayerSource not being "youtube".

Both now match the guard already present in packages/server/src/services/generation/agent-resolution.ts. Server-only change; no client edits.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

pnpm check passes locally. Boxes left unticked while this is a draft, pending a final maintainer pass.

Verified on a self-hosted Docker deployment of this branch, replaying the exact game-mode "Retry Music DJ" request against a Music DJ configured for YouTube:

  • Before: the retry SSE stream ran the agent with the six Spotify tools bound and emitted no agent_result (agent_start → agent_debug → done), so the client reported agentResultCount === 0 and showed "No agents ran…".
  • After: the agent runs with no tools and emits an agent_result with resultType: "youtube_control", success: true, and a mood-matched searchQuery (e.g. "Nier Automata – Weight of the World … instrumental"), so the embedded player plays the track.

To re-verify in the app: in a Game Mode chat with Music DJ (YouTube) configured (a YouTube Data API key + a connection), click "Retry Music DJ" — a YouTube track should load and play, with no "No agents ran" toast. Spotify-mode Music DJ is unaffected (it still gets its tools).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

This is a server bugfix with no user-facing config or behavior docs to update.

UI evidence (if applicable)

Not applicable — server fix; the visible effect is the embedded player resuming playback in YouTube mode.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Music DJ agents configured to use YouTube mode to no longer receive automatic Spotify tool assignments. These agents will now operate as intended without unnecessary tool backfilling.

🔄 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/2566 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 6/15/2026 **Status:** ✅ Merged **Merged:** 6/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/music-dj-youtube-no-result` --- ### 📝 Commits (3) - [`dafd8f7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dafd8f7f368c7be54c6e25f0c00ad5b51cf849ba) fix(music-dj): don't bind Spotify tools to the YouTube-mode Music DJ - [`364ddb4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/364ddb44eda351cb75180dd11bdad66453d1e43e) Merge branch 'staging' into fix/music-dj-youtube-no-result - [`a72702d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a72702d5a9112f5456d30e4ef49325d6f14d909f) Merge branch 'staging' into fix/music-dj-youtube-no-result ### 📊 Changes **2 files changed** (+11 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+3 -1) 📝 `packages/server/src/services/generation/tool-resolution-runtime.ts` (+8 -1) </details> ### 📄 Description ## Linked issue Closes #2565 ## Why this change - After the Spotify and YouTube DJ agents were merged into the unified Music DJ agent, the Music DJ in YouTube mode stopped playing: it emitted no result and showed "No agents ran. Add tracker agents…". This restores YouTube Music DJ. ## What changed The Music DJ agent (type `spotify`) runs as a pure-JSON agent when `musicProvider` is `"youtube"` — it returns a search query and the client plays the result in the embedded player, so it has no tools by design. Two tool-binding paths backfilled the full Spotify tool set whenever a `"spotify"`-type agent had an empty `enabledTools` list, without checking the music provider, which turned the YouTube Music DJ into a tool-calling agent that never emitted a `youtube_control` result. - `packages/server/src/routes/generate/retry-agents-route.ts`: gate the empty-tools → all-Spotify-tools backfill on `!musicAgentUsesYoutube(settings)`. - `packages/server/src/services/generation/tool-resolution-runtime.ts`: gate the equivalent backfill on `musicProvider`/`musicPlayerSource` not being `"youtube"`. Both now match the guard already present in `packages/server/src/services/generation/agent-resolution.ts`. Server-only change; no client edits. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes `pnpm check` passes locally. Boxes left unticked while this is a draft, pending a final maintainer pass. Verified on a self-hosted Docker deployment of this branch, replaying the exact game-mode "Retry Music DJ" request against a Music DJ configured for YouTube: - **Before:** the retry SSE stream ran the agent with the six Spotify tools bound and emitted **no** `agent_result` (`agent_start → agent_debug → done`), so the client reported `agentResultCount === 0` and showed "No agents ran…". - **After:** the agent runs with **no** tools and emits an `agent_result` with `resultType: "youtube_control"`, `success: true`, and a mood-matched `searchQuery` (e.g. "Nier Automata – Weight of the World … instrumental"), so the embedded player plays the track. To re-verify in the app: in a Game Mode chat with Music DJ (YouTube) configured (a YouTube Data API key + a connection), click "Retry Music DJ" — a YouTube track should load and play, with no "No agents ran" toast. Spotify-mode Music DJ is unaffected (it still gets its tools). ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) This is a server bugfix with no user-facing config or behavior docs to update. ## UI evidence (if applicable) Not applicable — server fix; the visible effect is the embedded player resuming playback in YouTube mode. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed Music DJ agents configured to use YouTube mode to no longer receive automatic Spotify tool assignments. These agents will now operate as intended without unnecessary tool backfilling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:16 +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#5661
No description provided.