[PR #2812] [MERGED] fix(agents): reflect YouTube provider in Music DJ editor prompt + tools #5744

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

📋 Pull Request Information

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

Base: staging ← Head: fix/music-dj-youtube-editor-display


📝 Commits (2)

  • 2db0f8b fix(agents): reflect YouTube provider in Music DJ editor prompt + tools
  • 9bb1ec7 Merge branch 'staging' into fix/music-dj-youtube-editor-display

📊 Changes

1 file changed (+66 additions, -44 deletions)

View changed files

📝 packages/client/src/components/agents/AgentEditor.tsx (+66 -44)

📄 Description

Linked issue

Closes #2811

Why this change

  • After the Spotify/YouTube merge, switching the Music DJ "Music Player" provider to YouTube left the agent editor looking like YouTube mode was half-implemented: the Prompt Template preview still showed the Spotify built-in prompt, and the Tools / Function Calling section showed a bare "0/15 enabled" with the (now inert) Spotify tool toggles still listed.
  • This is purely an editor-display gap. At generation time the backend already does the right thing for YouTube — it swaps to the YouTube built-in prompt (getAgentFallbackPrompt / getDefaultPromptForAgent) and forces enabledTools: [] via applyMusicPlayerSourceToMusicDjSettings. The editor just wasn't reflecting the selected provider in those two sections, which led to a user reporting the YouTube prompt and tools as "missing."

What changed

  • packages/client/src/components/agents/AgentEditor.tsx:
    • Added a musicDjYoutubeMode flag (isMusicAgent && localMusicProvider === "youtube") and made the built-in defaultPrompt memo provider-aware, so the preview resolves getDefaultAgentPrompt("youtube") when the YouTube provider is selected — matching what the backend injects at runtime. (The memo moved a few lines down so it can read localMusicProvider/isMusicAgent.)
    • Made the Tools / Function Calling section provider-aware: in YouTube mode its summary now reads "Not used in YouTube mode" and the body shows a short explanatory note ("Music DJ returns its pick as JSON and the app plays the top YouTube search result") instead of the Spotify tool toggles, which are discarded on save anyway.
  • No backend, shared-package, or behavior changes — prompt selection and tool gating at generation time are untouched.

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

  • Manually verify in a browser: open the Music DJ agent editor, switch the Music Player provider to YouTube, and confirm the Prompt Template preview switches to the YouTube built-in prompt (short, searchQuery-based, no Spotify tool names).
  • Manually verify the Tools / Function Calling section in YouTube mode shows the "Not used in YouTube mode" summary and the explanatory note rather than the Spotify tool toggles.
  • Manually verify switching back to Spotify restores the Spotify prompt preview and the normal tool list / count.
  • Manually verify a Music DJ agent with a hand-edited custom prompt still shows that custom text (provider swap applies to the built-in default only).

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)

UI evidence (if applicable)

image

🔄 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/2812 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 6/23/2026 **Status:** ✅ Merged **Merged:** 6/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/music-dj-youtube-editor-display` --- ### 📝 Commits (2) - [`2db0f8b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2db0f8b7035933ccaac741d63b02b0af7ce82d9c) fix(agents): reflect YouTube provider in Music DJ editor prompt + tools - [`9bb1ec7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9bb1ec7a249fa110303fc4a73b7935cc17efeac7) Merge branch 'staging' into fix/music-dj-youtube-editor-display ### 📊 Changes **1 file changed** (+66 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+66 -44) </details> ### 📄 Description ## Linked issue Closes #2811 ## Why this change - After the Spotify/YouTube merge, switching the Music DJ "Music Player" provider to YouTube left the agent editor looking like YouTube mode was half-implemented: the Prompt Template preview still showed the Spotify built-in prompt, and the Tools / Function Calling section showed a bare "0/15 enabled" with the (now inert) Spotify tool toggles still listed. - This is purely an editor-display gap. At generation time the backend already does the right thing for YouTube — it swaps to the YouTube built-in prompt (`getAgentFallbackPrompt` / `getDefaultPromptForAgent`) and forces `enabledTools: []` via `applyMusicPlayerSourceToMusicDjSettings`. The editor just wasn't reflecting the selected provider in those two sections, which led to a user reporting the YouTube prompt and tools as "missing." ## What changed - `packages/client/src/components/agents/AgentEditor.tsx`: - Added a `musicDjYoutubeMode` flag (`isMusicAgent && localMusicProvider === "youtube"`) and made the built-in `defaultPrompt` memo provider-aware, so the preview resolves `getDefaultAgentPrompt("youtube")` when the YouTube provider is selected — matching what the backend injects at runtime. (The memo moved a few lines down so it can read `localMusicProvider`/`isMusicAgent`.) - Made the Tools / Function Calling section provider-aware: in YouTube mode its summary now reads "Not used in YouTube mode" and the body shows a short explanatory note ("Music DJ returns its pick as JSON and the app plays the top YouTube search result") instead of the Spotify tool toggles, which are discarded on save anyway. - No backend, shared-package, or behavior changes — prompt selection and tool gating at generation time are untouched. ## 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 - Manually verify in a browser: open the Music DJ agent editor, switch the Music Player provider to YouTube, and confirm the Prompt Template preview switches to the YouTube built-in prompt (short, `searchQuery`-based, no Spotify tool names). - Manually verify the Tools / Function Calling section in YouTube mode shows the "Not used in YouTube mode" summary and the explanatory note rather than the Spotify tool toggles. - Manually verify switching back to Spotify restores the Spotify prompt preview and the normal tool list / count. - Manually verify a Music DJ agent with a hand-edited custom prompt still shows that custom text (provider swap applies to the built-in default only). ## 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) ## UI evidence (if applicable) <img width="1568" height="773" alt="image" src="https://github.com/user-attachments/assets/bcfbba3f-a213-480d-9366-4a74d880c335" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:04 +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#5744
No description provided.