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([issue-703]): persist the video-model choice, not the resolved default

[._.]/ Adam Eivy549e375c1e97
diff --git a/server/services/pipeline/episodeVideo.js b/server/services/pipeline/episodeVideo.js
index 6a8a497785..584a099720 100644
--- a/server/services/pipeline/episodeVideo.js
+++ b/server/services/pipeline/episodeVideo.js
@@ -160,7 +160,13 @@ export async function startEpisodeVideoForIssue(issueId, options = {}) {
assertStageUnlocked(issue, 'episodeVideo');
const aspectRatio = options.aspectRatio || '16:9';
const quality = options.quality || 'standard';
- const modelId = options.modelId || settings?.videoGen?.defaultModelId || getDefaultVideoModelId();
+ // The user's picker choice: `null` = "Default model". Unlike aspectRatio /
+ // quality (whose defaults are fixed constants), the video default is a live
+ // user setting (videoGen.defaultModelId), so we persist the *choice* — not
+ // the resolved id — and keep "Default" following the setting across reloads.
+ // The CD project's renderer still needs a concrete model, so resolve one here.
+ const requestedModelId = options.modelId || null;
+ const modelId = requestedModelId || settings?.videoGen?.defaultModelId || getDefaultVideoModelId();
const project = await createCDProject({
name: `Pipeline: ${(series?.name || 'Series').slice(0, 60)} — ${(issue.title || issueId).slice(0, 60)}`,
@@ -182,12 +188,13 @@ export async function startEpisodeVideoForIssue(issueId, options = {}) {
cdProjectId: project.id,
// Persist the chosen render settings so a page reload restores the
// pickers — otherwise restart from a fresh tab would silently fall back
- // to defaults that the user can't see or adjust. modelId is the resolved
- // concrete id (a user "Default model" pick lands here as the actual id),
- // mirroring how aspectRatio/quality persist their resolved defaults.
+ // to defaults that the user can't see or adjust. modelId persists the
+ // user's CHOICE (null = "Default"), so a Default pick keeps tracking the
+ // videoGen.defaultModelId setting on reload instead of pinning to whatever
+ // it happened to resolve to at first render.
aspectRatio,
quality,
- modelId,
+ modelId: requestedModelId,
output: '',
errorMessage: '',
});
diff --git a/server/services/pipeline/episodeVideo.test.js b/server/services/pipeline/episodeVideo.test.js
index 614662c98e..76e4bbfff7 100644
--- a/server/services/pipeline/episodeVideo.test.js
+++ b/server/services/pipeline/episodeVideo.test.js
@@ -290,15 +290,19 @@ describe('pipeline episodeVideo helper', () => {
expect(refreshed.stages.episodeVideo.modelId).toBe('ltx2_unified');
});
- it('startEpisodeVideoForIssue falls back to the default video model when modelId is omitted', async () => {
+ it('startEpisodeVideoForIssue resolves a concrete default for the CD project but records the Default choice (null) on the stage', async () => {
const { issue } = await seedSeriesAndIssue({
scenes: [{ description: 'foo' }],
});
await svc.startEpisodeVideoForIssue(issue.id);
- // mediaModels mock resolves the default to 'ltx23_distilled_q4'.
+ // The renderer needs a concrete id — mediaModels mock resolves the default
+ // to 'ltx23_distilled_q4'.
expect(cdCreated[0].modelId).toBe('ltx23_distilled_q4');
+ // ...but the stage records the *choice* (null = Default) so a Default pick
+ // keeps following the videoGen.defaultModelId setting across reloads
+ // instead of pinning to the first-resolved id.
const refreshed = await issuesSvc.getIssue(issue.id);
- expect(refreshed.stages.episodeVideo.modelId).toBe('ltx23_distilled_q4');
+ expect(refreshed.stages.episodeVideo.modelId).toBeNull();
});
it('startEpisodeVideoForIssue reuses an existing cdProjectId by default', async () => {