Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: song source on the autopilot Schedule form too, shared picker (#9473)

Adam Eivy6d9672e1714f
diff --git a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
index a6c1eec617..1caf43db87 100644
--- a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
+++ b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
@@ -3,6 +3,7 @@ import ToggleChip from '../../../ui/ToggleChip';
import ProviderModelSelector from '../../../ProviderModelSelector';
import ToolPicker from '../../../musicVideo/ToolPicker';
import MoodBoardPicker from '../../../musicVideo/MoodBoardPicker';
+import SongSourcePicker from '../../../musicVideo/SongSourcePicker';
import useProviderModels from '../../../../hooks/useProviderModels';
import {
AUTONOMOUS_CHECKPOINT_IDS, AUTONOMOUS_CHECKPOINT_LABELS, autopilotDraftFromParams, autopilotParamsFromDraft,
@@ -13,7 +14,7 @@ const inputClass = 'w-full min-w-0 bg-port-bg border border-port-border rounded
/**
* Settings for the `music-video-autopilot` scheduled task, stored in
* `taskMetadata.musicVideoAutopilot`: the same fields as the Autonomous start
- * drawer (tools, per-tool models, budget, limits, checkpoints, LLM, mood
+ * drawer (song source, tools, per-tool models, budget, limits, checkpoints, LLM, mood
* board) plus the Brain idea tags a run may draw from. Saved explicitly — the
* form holds a draft so a half-edited budget never hits the server.
*/
@@ -65,6 +66,8 @@ export default function MusicVideoAutopilotSettings({ taskType, config, onUpdate
<input id="mv-ap-idea-tags" value={draft.ideaTags} onChange={(e) => patch({ ideaTags: e.target.value })} placeholder="song, music — comma separated; blank = any active idea" className={inputClass} />
</div>
+ <SongSourcePicker idPrefix="mv-ap" songSource={draft.songSource} localFallback={draft.localFallback} onChange={patch} />
+
<ToggleChip id="mv-ap-instrumental" label="Instrumental (no vocals)" checked={draft.instrumental} onToggle={() => patch({ instrumental: !draft.instrumental })} />
<ToolPicker idPrefix="mv-ap" tools={draft.tools} models={draft.models} onChange={patch} />
diff --git a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
index 1231ea00bd..2691302cbc 100644
--- a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
+++ b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
@@ -43,6 +43,17 @@ describe('MusicVideoAutopilotSettings', () => {
});
});
+ it('round-trips the song source and the Suno fallback opt-in through the saved params', async () => {
+ const onUpdate = vi.fn(async () => {});
+ const config = { taskMetadata: { musicVideoAutopilot: { songSource: 'suno', localFallback: true } } };
+ render(<MusicVideoAutopilotSettings taskType="music-video-autopilot" config={config} onUpdate={onUpdate} updating={false} setUpdating={() => {}} />);
+ expect(screen.getByLabelText('Render locally if Suno is unavailable').checked).toBe(true);
+ fireEvent.change(screen.getByLabelText('Song source'), { target: { value: 'local' } });
+ fireEvent.click(screen.getByText('Save settings'));
+ await waitFor(() => expect(onUpdate).toHaveBeenCalled());
+ expect(onUpdate.mock.calls[0][1].taskMetadata.musicVideoAutopilot).toMatchObject({ songSource: 'local', localFallback: false });
+ });
+
it('keeps a saved writer-LLM pin when saved before the provider catalog loads', async () => {
const onUpdate = vi.fn(async () => {});
const config = { taskMetadata: { musicVideoAutopilot: { llm: { providerId: 'prov-1', model: 'm-1' } } } };
diff --git a/client/src/components/musicVideo/AutonomousStartDrawer.jsx b/client/src/components/musicVideo/AutonomousStartDrawer.jsx
index a58330b4cf..40c4a3f8ea 100644
--- a/client/src/components/musicVideo/AutonomousStartDrawer.jsx
+++ b/client/src/components/musicVideo/AutonomousStartDrawer.jsx
@@ -4,12 +4,13 @@ import Drawer from '../Drawer.jsx';
import ToggleChip from '../ui/ToggleChip.jsx';
import ToolPicker from './ToolPicker.jsx';
import MoodBoardPicker from './MoodBoardPicker.jsx';
+import SongSourcePicker from './SongSourcePicker.jsx';
import ProviderModelSelector from '../ProviderModelSelector.jsx';
import toast from '../ui/Toast';
import useProviderModels from '../../hooks/useProviderModels.js';
import { startAutonomousMusicVideo } from '../../services/apiMusicVideo.js';
import {
- AUTONOMOUS_CHECKPOINT_IDS, AUTONOMOUS_CHECKPOINT_LABELS, AUTONOMOUS_SONG_SOURCES, AUTONOMOUS_SONG_SOURCE_LABELS, autonomousRequestFromDraft, emptyAutonomousDraft,
+ AUTONOMOUS_CHECKPOINT_IDS, AUTONOMOUS_CHECKPOINT_LABELS, autonomousRequestFromDraft, emptyAutonomousDraft,
} from '../../lib/musicVideoAutonomous.js';
const inputClass = 'w-full min-w-0 bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm';
@@ -75,34 +76,7 @@ export default function AutonomousStartDrawer({ open, onClose, onStarted }) {
</p>
</div>
- <div>
- <label htmlFor="mv-auto-song-source" className="block text-xs text-port-text-muted mb-1">Song source</label>
- <select
- id="mv-auto-song-source"
- value={draft.songSource}
- onChange={(e) => patch({ songSource: e.target.value })}
- className={inputClass}
- >
- {AUTONOMOUS_SONG_SOURCES.map((source) => (
- <option key={source} value={source}>{AUTONOMOUS_SONG_SOURCE_LABELS[source]}</option>
- ))}
- </select>
- <p className="text-[11px] text-port-text-muted mt-1">
- {draft.songSource === 'suno'
- ? 'Suno is driven through the PortOS Browser — sign in to Suno there first. It spends Suno credits.'
- : 'Rendered on this machine by a ready Music Studio engine (a lyric-capable one such as ACE-Step for vocals). Free, but it queues behind other GPU work.'}
- </p>
- {draft.songSource === 'suno' && (
- <div className="mt-2">
- <ToggleChip
- id="mv-auto-local-fallback"
- label="Render locally if Suno is unavailable"
- checked={draft.localFallback}
- onToggle={() => patch({ localFallback: !draft.localFallback })}
- />
- </div>
- )}
- </div>
+ <SongSourcePicker idPrefix="mv-auto" songSource={draft.songSource} localFallback={draft.localFallback} onChange={patch} />
<ToggleChip id="mv-auto-instrumental" label="Instrumental (no vocals)" checked={draft.instrumental} onToggle={() => patch({ instrumental: !draft.instrumental })} />
diff --git a/client/src/components/musicVideo/SongSourcePicker.jsx b/client/src/components/musicVideo/SongSourcePicker.jsx
new file mode 100644
index 0000000000..ee0b1b6893
--- /dev/null
+++ b/client/src/components/musicVideo/SongSourcePicker.jsx
@@ -0,0 +1,43 @@
+import ToggleChip from '../ui/ToggleChip.jsx';
+import { AUTONOMOUS_SONG_SOURCES, AUTONOMOUS_SONG_SOURCE_LABELS } from '../../lib/musicVideoAutonomous.js';
+
+const inputClass = 'w-full min-w-0 bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm';
+
+/**
+ * Where an autonomous run's song comes from — Suno through the PortOS Browser or
+ * a local Music Studio engine — plus the Suno-only opt-in to render locally when
+ * Suno cannot take the request. Shared by the start drawer and the autopilot
+ * Schedule form; `onChange` receives a partial draft patch.
+ */
+export default function SongSourcePicker({ idPrefix, songSource, localFallback, onChange }) {
+ return (
+ <div>
+ <label htmlFor={`${idPrefix}-song-source`} className="block text-xs text-port-text-muted mb-1">Song source</label>
+ <select
+ id={`${idPrefix}-song-source`}
+ value={songSource}
+ onChange={(e) => onChange({ songSource: e.target.value })}
+ className={inputClass}
+ >
+ {AUTONOMOUS_SONG_SOURCES.map((source) => (
+ <option key={source} value={source}>{AUTONOMOUS_SONG_SOURCE_LABELS[source]}</option>
+ ))}
+ </select>
+ <p className="text-[11px] text-port-text-muted mt-1">
+ {songSource === 'suno'
+ ? 'Suno is driven through the PortOS Browser — sign in to Suno there first. It spends Suno credits.'
+ : 'Rendered on this machine by a ready Music Studio engine (a lyric-capable one such as ACE-Step for vocals). Free, but it queues behind other GPU work.'}
+ </p>
+ {songSource === 'suno' && (
+ <div className="mt-2">
+ <ToggleChip
+ id={`${idPrefix}-local-fallback`}
+ label="Render locally if Suno is unavailable"
+ checked={localFallback}
+ onToggle={() => onChange({ localFallback: !localFallback })}
+ />
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/client/src/lib/musicVideoAutonomous.js b/client/src/lib/musicVideoAutonomous.js
index a0c3d20d28..c5bb0f3aa3 100644
--- a/client/src/lib/musicVideoAutonomous.js
+++ b/client/src/lib/musicVideoAutonomous.js
@@ -84,6 +84,8 @@ export function autopilotDraftFromParams(params) {
const { prompt: _prompt, ...base } = emptyAutonomousDraft();
return {
...base,
+ songSource: AUTONOMOUS_SONG_SOURCES.includes(p.songSource) ? p.songSource : base.songSource,
+ localFallback: p.localFallback === true,
instrumental: p.instrumental === true,
tools: Array.isArray(p.tools) ? [...p.tools] : base.tools,
models: { ...(p.models || {}) },
@@ -98,8 +100,7 @@ export function autopilotDraftFromParams(params) {
/**
* The `musicVideoAutopilot` params a draft saves. Starts from the saved params
- * so fields the form does not edit (review attempts, authoring provider, song
- * source) survive a save; the server re-normalizes it all on write.
+ * so fields the form does not edit (review attempts, authoring provider) survive a save; the server re-normalizes it all on write.
*/
export function autopilotParamsFromDraft(draft, saved, { providerId, model } = {}) {
const { prompt: _prompt, ...request } = autonomousRequestFromDraft({ ...draft, prompt: '' }, {});