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: music-video renders no longer blocked by a failed Video Gen status read (#12808)

[._.]/ Adam Eivy1da8febe7cd0
diff --git a/client/src/components/musicVideo/VideoRenderSettings.jsx b/client/src/components/musicVideo/VideoRenderSettings.jsx
index e0cd7ed094..91af3baab3 100644
--- a/client/src/components/musicVideo/VideoRenderSettings.jsx
+++ b/client/src/components/musicVideo/VideoRenderSettings.jsx
@@ -1,4 +1,5 @@
import RenderPoolPicker from './RenderPoolPicker.jsx';
+import ListLoadError from '../ui/ListLoadError.jsx';
import { GROK_VIDEO_DURATIONS } from '../../lib/grokVideoClip.js';
import {
FAL_DEFAULT_IMAGE_VIDEO_MODEL, FAL_MUSIC_VIDEO_DEFAULT_MODEL, FAL_IMAGE_VIDEO_MODELS, describeFalVideoRate, falImageVideoQuotes, falVideoResolutions, getFalVideoModel,
@@ -28,7 +29,7 @@ const runwayOptionLabel = (model, resolution) => {
// board's displayed setting cannot disagree.
export default function VideoRenderSettings({ videoSettings, generating, project = null }) {
const {
- settings, saving, models, modelsLoading, defaultModel, effectiveModelId,
+ settings, saving, models, modelsLoading, catalogStatus, retryCatalog, defaultModel, effectiveModelId,
audioReactiveModels, audioReactiveLoras, detectedAudioReactiveLora,
audioReactiveReady, audioReactiveSelected, change,
} = videoSettings;
@@ -61,6 +62,9 @@ export default function VideoRenderSettings({ videoSettings, generating, project
const runwayLengths = runwayVideoLengths(runwayModel);
return (
<>
+ {catalogStatus === 'error' && (
+ <ListLoadError what="Video Gen status" onRetry={retryCatalog} className="w-full" />
+ )}
<RenderPoolPicker settings={settings} change={change} disabled={locked} />
<label htmlFor="mv-video-backend" className="sr-only">Scene video renderer</label>
<select
@@ -138,7 +142,9 @@ export default function VideoRenderSettings({ videoSettings, generating, project
title="Saved audio-reactive LoRA version for this project"
className="w-full max-w-full bg-port-bg border border-port-border rounded px-1.5 py-1.5 text-sm disabled:opacity-50 min-h-[44px] sm:min-h-0 sm:w-auto sm:max-w-[220px]"
>
- {audioReactiveLoras.length === 0 && <option value="">No audio-reactive LoRA installed</option>}
+ {audioReactiveLoras.length === 0 && (
+ <option value="">{catalogStatus === 'ready' ? 'No audio-reactive LoRA installed' : 'Audio-reactive LoRAs not loaded'}</option>
+ )}
{audioReactiveLoras.map((lora) => (
<option key={lora.filename} value={lora.filename}>
{lora.name || lora.filename}
@@ -162,13 +168,13 @@ export default function VideoRenderSettings({ videoSettings, generating, project
className={`text-[10px] px-1.5 py-0.5 rounded ${
audioReactiveReady
? 'bg-port-success/20 text-port-success'
- : (modelsLoading ? 'bg-port-warning/20 text-port-warning' : 'bg-port-error/20 text-port-error')
+ : (modelsLoading || catalogStatus !== 'ready' ? 'bg-port-warning/20 text-port-warning' : 'bg-port-error/20 text-port-error')
}`}
title={detectedAudioReactiveLora?.filename || 'Audio-reactive LoRA not installed'}
>
{audioReactiveReady
? 'song-conditioned · no vocals'
- : (modelsLoading ? 'checking local runtime…' : 'audio-reactive unavailable')}
+ : (catalogStatus === 'error' ? 'status unavailable' : modelsLoading || catalogStatus === 'loading' ? 'checking local runtime…' : 'audio-reactive unavailable')}
</span>
</>
)}
diff --git a/client/src/components/musicVideo/VideoRenderSettings.test.jsx b/client/src/components/musicVideo/VideoRenderSettings.test.jsx
new file mode 100644
index 0000000000..b1a6768fa4
--- /dev/null
+++ b/client/src/components/musicVideo/VideoRenderSettings.test.jsx
@@ -0,0 +1,26 @@
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, fireEvent } from '@testing-library/react';
+import VideoRenderSettings from './VideoRenderSettings.jsx';
+
+const base = {
+ settings: { backend: 'local', generationMode: 'audioReactive', modelId: '', audioReactiveLora: '', audioReactiveScale: 1.2 },
+ saving: false, models: [], modelsLoading: false, defaultModel: '', effectiveModelId: '',
+ audioReactiveModels: [], audioReactiveLoras: [], detectedAudioReactiveLora: null,
+ audioReactiveReady: false, change: vi.fn(),
+};
+
+describe('VideoRenderSettings catalog failure', () => {
+ it('offers Retry instead of claiming audio-reactive is unavailable', () => {
+ const retryCatalog = vi.fn();
+ render(<VideoRenderSettings videoSettings={{ ...base, catalogStatus: 'error', retryCatalog }} />);
+ expect(screen.queryByText('audio-reactive unavailable')).toBeNull();
+ fireEvent.click(screen.getByRole('button', { name: 'Retry' }));
+ expect(retryCatalog).toHaveBeenCalledTimes(1);
+ });
+
+ it('keeps the unavailable copy after a successful read', () => {
+ render(<VideoRenderSettings videoSettings={{ ...base, catalogStatus: 'ready', retryCatalog: vi.fn() }} />);
+ expect(screen.getByText('audio-reactive unavailable')).toBeTruthy();
+ expect(screen.queryByRole('button', { name: 'Retry' })).toBeNull();
+ });
+});
diff --git a/client/src/hooks/README.md b/client/src/hooks/README.md
index cd9b0618cc..3c1eba011d 100644
--- a/client/src/hooks/README.md
+++ b/client/src/hooks/README.md
@@ -275,7 +275,7 @@ grep -i "what you want to do" client/src/hooks/README.md
| `useMusicVideoCoverLettering` | Music Video cover Lettering controls (#10345): the install's uploaded typefaces and saved per-artist styles, loaded once. Loads whenever `enabled` (the section is open). Returns `{ fonts, styles, uploading, uploadFont(file), removeFont(id), saveStyle({ name, design }), removeStyle(name) }` (`fonts`/`styles` null until loaded); each mutation applies the server's answer at once. | `CoverArtPanel` (Publish stage). |
| `useMusicVideoPublishKit` | Music Video publishing kit (#9281): a `useSseJobSlot` build job (encodes, thumbnails, captions, chapters) whose terminal frame reloads the project, plus the one-call copy draft, per-field copy edits, the YouTube thumbnail and cover art, each applying the returned project. Returns `{ building, progress, build(), cancelBuild(), drafting, saving, draftCopy(body), saveCopy(patch), composingThumbnail, composeThumbnail(body), clearThumbnail(), addThumbnailTest(), removeThumbnailTest(filename), paintingThumbnail, paintThumbnail(body), … }` plus the cover-art actions. | The Music Video Publish stage. |
| `useMusicVideoPublishing` | Music Video posting (#9282): per-platform drafts filled in the PortOS Browser. `prepare` returns the filled draft's summary and screenshot (a sign-in-required refusal is kept as the platform's error with its login URL), `submit` posts that reviewed draft and applies the returned project, `discard` closes it. Platforms are opt-in (#9287): it loads the saved `platforms` (enabled + optional account each) and per-platform `history` (posts, reception tally, recent notes across projects); `setPlatform` toggles one optimistically and `recordPost` saves a hand-made post's link or a post's reception and notes. Returns `{ drafts, busy, errors, prepare(target, options), submit(target), discard(target), platforms, history, enabledTargets, setPlatform(target, change), recordPost(target, body) }`. | The Music Video Publish stage's posting panel. |
-| `useMusicVideoModelSettings` | A project's saved render pins — video backend (local/Grok/fal.ai)/model/generation-mode/audio-reactive LoRA + the image-side frame pin — with the Video Gen catalog they read from. Optimistic-local + silent PATCH, rollback + toast on failure; `saving` gates the dependent generate buttons. Returns `{ models, modelsLoading, defaultModel, falEnabled, saving, settings, effectiveModelId, activeModel, audioReactiveModels, audioReactiveLoras, detectedAudioReactiveLora, audioReactiveReady, audioReactiveSelected, videoBlockedReason, change, changeFramePin }`. `videoBlockedReason` is the single "why can't I generate" string (an unavailable audio-reactive setup, or a fal.ai pin with no configured API key) shared by the disabled buttons, their tooltips, and the blocked-call toast. | The Music Video renderer selects and anything building a scene-clip job payload from them. |
+| `useMusicVideoModelSettings` | A project's saved render pins — video backend (local/Grok/fal.ai)/model/generation-mode/audio-reactive LoRA + the image-side frame pin — with the Video Gen catalog they read from. Optimistic-local + silent PATCH, rollback + toast on failure; `saving` gates the dependent generate buttons. Returns `{ models, modelsLoading, catalogStatus ('loading'|'ready'|'error'), retryCatalog, defaultModel, falEnabled (null until read), runwayEnabled, saving, settings, effectiveModelId, activeModel, audioReactiveModels, audioReactiveLoras, detectedAudioReactiveLora, audioReactiveReady, audioReactiveSelected, videoBlockedReason, change, changeFramePin }`. `videoBlockedReason` is the single "why can't I generate" string (an unavailable audio-reactive setup, or a fal.ai pin with no configured API key; a pending or failed catalog read says so instead of claiming a missing key) shared by the disabled buttons, their tooltips, and the blocked-call toast. | The Music Video renderer selects and anything building a scene-clip job payload from them. |
| `useMusicVideoSceneMedia` | Both per-scene generation lanes (reference frame + scene clip) over `useSceneRenderLifecycle`, the frame/shot prompt builders (concept-style + visual-spec direction suffix), visual-spec reference-image conditioning with explicit unsupported-backend feedback (#8965), the batch "generate the missing ones" actions, restores in-flight scene renders from the server queue on mount (`getMusicVideoSceneJobs`) so a reload doesn't invite duplicate submits, and folds the persisted `scene.lastFailure` (socket `music-video:scene-failure`) onto the scene (#10154). Loads the Casting media of each cast member a shot names in `characterVariant` (#12763) so frame conditioning leads with their guides. Returns `{ genScenes, genVideoScenes, conditioning, castMedia, buildFramePrompt, buildShotPrompt, generateFrame, generateSceneVideo, continueSceneVideo, generateMissingFrames, generateMissingVideos, planMissingFrames, planMissingVideos, frameBatch, videoBatch, sceneProgress, videoSceneProgress }` (the batches run counted via `useSceneBatch`; the board confirms count + estimate before calling `generateMissing*`). | The Music Video scene board — don't re-wire the two lanes or re-derive the i2v/a2v/extend payloads. |
| `useMusicVideoTakes` | Scene-take review + external-asset handoff for the Music Video board (#8965): serialized select / reject / note / gallery-import take mutations folded back as scene patches, the handoff manifest download, and the handoff import (gallery upload per file, then scene association by file tag with provider provenance). Returns `{ busy, selectTake, reviewTake, importTake, exportHandoff, importHandoffFiles }`. | The Music Video board's take strips, contact sheet and handoff row — don't re-sequence take mutations per call site. |
| `useMusicVideoTreatment` | The Music Video pre-production treatment (#8980): serialized brief/arc/shot-direction saves that each carry the latest known treatment revision (a 409 from a newer copy reloads the project), explicit compile (AI or deterministic) with skip-reason feedback, the Apply review (`loadPreview` → `apply({ overwrite, addTextCues })`) and proof verdicts. Returns `{ compiling, preview, previewing, applying, save, compile, loadPreview, apply, reviewProof, clearPreview }`. | The Music Video treatment panel — don't re-derive the revision bookkeeping per call site. |
diff --git a/client/src/hooks/useMusicVideoModelSettings.js b/client/src/hooks/useMusicVideoModelSettings.js
index 5973e31a13..9f2ac2f51a 100644
--- a/client/src/hooks/useMusicVideoModelSettings.js
+++ b/client/src/hooks/useMusicVideoModelSettings.js
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
import toast from '../components/ui/Toast';
import { updateMusicVideoProject } from '../services/apiMusicVideo.js';
import { getVideoGenStatus, listLorasFull } from '../services/apiImageVideo.js';
@@ -23,17 +23,26 @@ const isLtx23 = (model) => !!model
*/
export default function useMusicVideoModelSettings({ project, onProjectPatch } = {}) {
const [models, setModels] = useState([]);
- const [modelsLoading, setModelsLoading] = useState(true);
+ const [statusRead, setStatusRead] = useState('loading');
+ const [loraRead, setLoraRead] = useState('loading');
const [loras, setLoras] = useState([]);
const [defaultModel, setDefaultModel] = useState('');
- const [falEnabled, setFalEnabled] = useState(false);
- const [runwayEnabled, setRunwayEnabled] = useState(false);
+ // null = unknown (read pending or failed) — never collapsed into "not configured".
+ const [falEnabled, setFalEnabled] = useState(null);
+ const [runwayEnabled, setRunwayEnabled] = useState(null);
+ const catalogGeneration = useRef(0);
const [saving, setSaving] = useState(false);
const [framePinSaving, setFramePinSaving] = useState(false);
- useEffect(() => {
+ // A superseded read (retry, unmount) is dropped by the generation check.
+ const loadCatalog = useCallback(() => {
+ const generation = ++catalogGeneration.current;
+ const current = () => generation === catalogGeneration.current;
+ setStatusRead('loading');
+ setLoraRead('loading');
getVideoGenStatus({ silent: true })
.then((status) => {
+ if (!current()) return;
// Music-video scenes always start from a reference frame. Hide
// explicitly text-only models, while retaining general LTX models
// whose runtime supports both text and image conditioning.
@@ -45,18 +54,27 @@ export default function useMusicVideoModelSettings({ project, onProjectPatch } =
// general Video Gen page's `falEnabled`).
setFalEnabled(status?.falEnabled === true);
setRunwayEnabled(status?.runwayEnabled === true);
- setModelsLoading(false);
+ setStatusRead('ready');
})
- .catch(() => {
- setModels([]);
- setDefaultModel('');
- setModelsLoading(false);
- });
+ .catch(() => { if (current()) setStatusRead('error'); });
listLorasFull({ silent: true })
- .then((installed) => setLoras(Array.isArray(installed) ? installed : []))
- .catch(() => setLoras([]));
+ .then((installed) => {
+ if (!current()) return;
+ setLoras(Array.isArray(installed) ? installed : []);
+ setLoraRead('ready');
+ })
+ .catch(() => { if (current()) setLoraRead('error'); });
}, []);
+ useEffect(() => {
+ loadCatalog();
+ return () => { catalogGeneration.current += 1; };
+ }, [loadCatalog]);
+
+ const combinedStatus = (...reads) => (reads.includes('error') ? 'error' : reads.includes('loading') ? 'loading' : 'ready');
+ const catalogStatus = combinedStatus(statusRead, loraRead);
+ const modelsLoading = statusRead === 'loading';
+
const settings = {
renderPool: project?.videoSettings?.renderPool,
// Empty means this peer resolves its own configured Video Gen default.
@@ -116,13 +134,25 @@ export default function useMusicVideoModelSettings({ project, onProjectPatch } =
// preflight reason rather than a request that reaches the server only to
// fail with FAL_NOT_CONFIGURED (#8968) — no silent fallback to local/Grok.
// `blockedReasonFor` answers the same for a one-shot render with other settings (a scene card's Render on pick).
- const blockedReasonFor = (pick) => (pick.backend === 'local' && pick.generationMode === 'audioReactive' && !audioReactiveReady
- ? 'Audio-reactive generation requires an installed LTX-2.3 audio-reactive LoRA and an LTX-2.3 local model'
- : pick.backend === 'fal' && !falEnabled
- ? 'No fal.ai API key configured — set it in Settings → Video Gen (or the FAL_KEY env var) first'
- : pick.backend === 'runway' && !runwayEnabled
- ? 'No Runway API key configured — set it in Settings → Video Gen (or the RUNWAYML_API_SECRET env var) first'
- : null);
+ // While the catalog read is pending or failed the answer is unknown, so the
+ // reason names that state instead of claiming a key or LoRA is missing.
+ const blockedReasonFor = (pick) => {
+ const reads = pick.backend === 'local' && pick.generationMode === 'audioReactive'
+ ? combinedStatus(statusRead, loraRead)
+ : pick.backend === 'fal' || pick.backend === 'runway' ? statusRead : 'ready';
+ if (reads === 'error') return "Couldn't read Video Gen status — retry before rendering";
+ if (reads === 'loading') return 'Checking Video Gen status…';
+ if (pick.backend === 'local' && pick.generationMode === 'audioReactive' && !audioReactiveReady) {
+ return 'Audio-reactive generation requires an installed LTX-2.3 audio-reactive LoRA and an LTX-2.3 local model';
+ }
+ if (pick.backend === 'fal' && !falEnabled) {
+ return 'No fal.ai API key configured — set it in Settings → Video Gen (or the FAL_KEY env var) first';
+ }
+ if (pick.backend === 'runway' && !runwayEnabled) {
+ return 'No Runway API key configured — set it in Settings → Video Gen (or the RUNWAYML_API_SECRET env var) first';
+ }
+ return null;
+ };
const videoBlockedReason = blockedReasonFor(settings);
const change = (patch) => {
@@ -176,6 +206,9 @@ export default function useMusicVideoModelSettings({ project, onProjectPatch } =
return {
models,
modelsLoading,
+ catalogStatus,
+ statusRead,
+ retryCatalog: loadCatalog,
defaultModel,
falEnabled,
runwayEnabled,
diff --git a/client/src/hooks/useMusicVideoModelSettings.test.jsx b/client/src/hooks/useMusicVideoModelSettings.test.jsx
new file mode 100644
index 0000000000..d693d07d9e
--- /dev/null
+++ b/client/src/hooks/useMusicVideoModelSettings.test.jsx
@@ -0,0 +1,56 @@
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { renderHook, waitFor, act } from '@testing-library/react';
+
+const api = vi.hoisted(() => ({ getVideoGenStatus: vi.fn(), listLorasFull: vi.fn() }));
+vi.mock('../services/apiImageVideo.js', () => api);
+vi.mock('../services/apiMusicVideo.js', () => ({ updateMusicVideoProject: vi.fn() }));
+vi.mock('../components/ui/Toast', () => ({ default: { error: vi.fn() } }));
+
+import useMusicVideoModelSettings from './useMusicVideoModelSettings.js';
+
+const render = () => renderHook(() => useMusicVideoModelSettings({ project: { id: 'p', videoSettings: {} } }));
+const FAL = { backend: 'fal' };
+const RUNWAY = { backend: 'runway' };
+const REACTIVE = { backend: 'local', generationMode: 'audioReactive' };
+
+describe('useMusicVideoModelSettings catalog status', () => {
+ beforeEach(() => {
+ api.getVideoGenStatus.mockReset();
+ api.listLorasFull.mockReset();
+ api.listLorasFull.mockResolvedValue([]);
+ });
+
+ it('reports a failed status read as a read failure, not a missing key or LoRA', async () => {
+ api.getVideoGenStatus.mockRejectedValue(new Error('boom'));
+ const { result } = render();
+ await waitFor(() => expect(result.current.catalogStatus).toBe('error'));
+ for (const pick of [FAL, RUNWAY, REACTIVE]) {
+ expect(result.current.blockedReasonFor(pick)).toMatch(/Couldn't read Video Gen status/);
+ }
+ });
+
+ it('does not report a failed LoRA read as a missing audio-reactive LoRA', async () => {
+ api.getVideoGenStatus.mockResolvedValue({ models: [], falEnabled: false });
+ api.listLorasFull.mockRejectedValue(new Error('boom'));
+ const { result } = render();
+ await waitFor(() => expect(result.current.catalogStatus).toBe('error'));
+ expect(result.current.blockedReasonFor(REACTIVE)).toMatch(/Couldn't read/);
+ });
+
+ it('keeps the key-missing reason when a successful read says fal is unconfigured', async () => {
+ api.getVideoGenStatus.mockResolvedValue({ models: [], falEnabled: false, runwayEnabled: false });
+ const { result } = render();
+ await waitFor(() => expect(result.current.catalogStatus).toBe('ready'));
+ expect(result.current.blockedReasonFor(FAL)).toMatch(/No fal.ai API key/);
+ expect(result.current.blockedReasonFor(RUNWAY)).toMatch(/No Runway API key/);
+ });
+
+ it('unblocks after a successful retry', async () => {
+ api.getVideoGenStatus.mockRejectedValueOnce(new Error('boom')).mockResolvedValue({ models: [], falEnabled: true });
+ const { result } = render();
+ await waitFor(() => expect(result.current.catalogStatus).toBe('error'));
+ act(() => result.current.retryCatalog());
+ await waitFor(() => expect(result.current.catalogStatus).toBe('ready'));
+ expect(result.current.blockedReasonFor(FAL)).toBeNull();
+ });
+});