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

Test the model recorded with each fal take and production step

Claude655cb79a18cc
diff --git a/server/services/musicVideo/productionPool.test.js b/server/services/musicVideo/productionPool.test.js
index bd8096bbda..ba927fdead 100644
--- a/server/services/musicVideo/productionPool.test.js
+++ b/server/services/musicVideo/productionPool.test.js
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
-import { assertFootageVideoModelsCapable, assertPoolEligible } from './productionPool.js';
+import { assertFootageVideoModelsCapable, assertPoolEligible, stepCostModelId, stepPriceUsd } from './productionPool.js';
// Blank local-video pins are the install default. The renderer already resolves
// that omission; Start must accept the same route instead of demanding an id.
@@ -67,3 +67,16 @@ describe('local image pool eligibility', () => {
await expect(assertPoolEligible([route], imageEnv([]))).rejects.toThrow(/not installed/);
});
});
+
+describe('fal step pricing names the model it priced', () => {
+ it('records the end-frame upgrade on an end-frame clip and the default elsewhere', () => {
+ const KLING = 'fal-ai/kling-video/v3/pro/image-to-video';
+ const project = { videoSettings: { falEndFrameModelId: KLING } };
+ const route = { kind: 'video', mode: 'fal', model: null };
+ const shot = { sceneId: 's', startSec: 0, endSec: 2 };
+ const step = (scene) => ({ route, project, scene, stepKind: 'clip' });
+ expect([stepCostModelId(step(shot)), stepPriceUsd(step(shot))]).toEqual(['fal-ai/minimax/hailuo-02/standard/image-to-video', 0.27]);
+ expect([stepCostModelId(step({ ...shot, endImageId: 'sketch.png' })), stepPriceUsd(step({ ...shot, endImageId: 'sketch.png' }))]).toEqual([KLING, 0.42]);
+ expect(stepCostModelId({ route: { kind: 'video', mode: 'local' }, project, scene: shot, stepKind: 'clip' })).toBeNull();
+ });
+});
diff --git a/server/services/musicVideo/takes.test.js b/server/services/musicVideo/takes.test.js
index ec69bf0d95..44f4b9161b 100644
--- a/server/services/musicVideo/takes.test.js
+++ b/server/services/musicVideo/takes.test.js
@@ -8,14 +8,16 @@ describe('take generation cost (#10157)', () => {
it('stores a finite quote and its spend kind, and omits both when unpriced or invalid', () => {
const input = { kind: 'video', source: 'generated' };
const { appended } = appendSceneTakes(project(), 's1', [
- { ...input, assetId: 'a', costUsd: 0.4, spendKind: 'autoReview' },
+ { ...input, assetId: 'a', costUsd: 0.4, spendKind: 'autoReview', costModelId: 'fal-ai/kling-video/v3/pro/image-to-video' },
{ ...input, assetId: 'b', costUsd: 0.1 },
- { ...input, assetId: 'c', costUsd: null },
+ { ...input, assetId: 'c', costUsd: null, costModelId: 'fal-ai/kling-video/v3/pro/image-to-video' },
{ ...input, assetId: 'd', costUsd: -3, spendKind: 'manual' },
]);
- expect(appended[0]).toMatchObject({ costUsd: 0.4, spendKind: 'autoReview' });
+ expect(appended[0]).toMatchObject({ costUsd: 0.4, spendKind: 'autoReview', costModelId: 'fal-ai/kling-video/v3/pro/image-to-video' });
expect(appended[1]).toMatchObject({ costUsd: 0.1, spendKind: 'manual' });
+ expect(appended[1]).not.toHaveProperty('costModelId');
expect(appended[2]).not.toHaveProperty('costUsd');
+ expect(appended[2]).not.toHaveProperty('costModelId');
expect(appended[3]).not.toHaveProperty('costUsd');
});
});