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

fix: keep the saved writer-LLM pin when saving before providers load (#9475)

Adam Eivy2183c5dfb5ce
diff --git a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
index 661bf2a7fd..a6c1eec617 100644
--- a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
+++ b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.jsx
@@ -44,9 +44,12 @@ export default function MusicVideoAutopilotSettings({ taskType, config, onUpdate
e.preventDefault();
if (updating) return;
setUpdating(true);
- const params = autopilotParamsFromDraft(draft, saved, {
- providerId: llm.selectedProviderId || undefined, model: llm.selectedModel || undefined,
- });
+ // Until the catalog has seeded the picker, "no selection" means "not loaded
+ // yet", not "use the install default" — keep the saved pin untouched.
+ const pin = llmSeeded
+ ? { providerId: llm.selectedProviderId || undefined, model: llm.selectedModel || undefined }
+ : { providerId: saved?.llm?.providerId, model: saved?.llm?.model || undefined };
+ const params = autopilotParamsFromDraft(draft, saved, pin);
await onUpdate(taskType, { taskMetadata: { ...config.taskMetadata, musicVideoAutopilot: params } }).catch(() => {});
setUpdating(false);
};
diff --git a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
index 730b025d20..1231ea00bd 100644
--- a/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
+++ b/client/src/components/cos/tabs/schedule/MusicVideoAutopilotSettings.test.jsx
@@ -42,4 +42,13 @@ describe('MusicVideoAutopilotSettings', () => {
limits: { maxGenerations: 10, maxReviewAttempts: 5 },
});
});
+
+ 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' } } } };
+ render(<MusicVideoAutopilotSettings taskType="music-video-autopilot" config={config} onUpdate={onUpdate} updating={false} setUpdating={() => {}} />);
+ fireEvent.click(screen.getByText('Save settings'));
+ await waitFor(() => expect(onUpdate).toHaveBeenCalled());
+ expect(onUpdate.mock.calls[0][1].taskMetadata.musicVideoAutopilot.llm).toEqual({ providerId: 'prov-1', model: 'm-1' });
+ });
});