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: honor target video model in prompt guidance

[._.]/ Adam Eivy53abeba0e14c
diff --git a/server/services/creativeCommissions/abilityAdapters.js b/server/services/creativeCommissions/abilityAdapters.js
index 8021b6d7f6..6373b99de6 100644
--- a/server/services/creativeCommissions/abilityAdapters.js
+++ b/server/services/creativeCommissions/abilityAdapters.js
@@ -103,11 +103,13 @@ function genValue(commission, key) {
return coerceGenerationValue(key, commission?.generation);
}
-function videoPromptGuidanceFor(commission, { defaultVideoModelId, effectiveVideoMode } = {}) {
+function videoPromptGuidanceFor(commission, {
+ defaultVideoModelId, effectiveVideoMode, effectiveVideoModelId,
+} = {}) {
const generation = commission?.generation;
const isCloudVideo = (effectiveVideoMode || generation?.videoMode) === VIDEO_GEN_MODE.GROK;
const modelId = isCloudVideo ? undefined : (
- generation?.videoModelId || generation?.model
+ generation?.videoModelId || generation?.model || effectiveVideoModelId
|| (typeof defaultVideoModelId === 'function' ? defaultVideoModelId() : undefined)
);
return buildVideoPromptGuidance(modelId);
@@ -189,11 +191,11 @@ const videoAdapter = {
label: 'Video',
sanitizeGeneration: (raw) => sanitizeGenerationFor('video', raw),
buildProjectParams: buildVideoGeometryParams,
- buildDirective(commission, { defaultVideoModelId, effectiveVideoMode } = {}) {
+ buildDirective(commission, { defaultVideoModelId, effectiveVideoMode, effectiveVideoModelId } = {}) {
const duration = commission?.generation?.durationMode === 'auto'
? ' Choose an appropriate duration between 5 and 600 seconds for the brief.' : '';
const { lines, digest, constraints } = briefContext(commission, `Create a short-form video piece.${duration}`);
- lines.unshift(videoPromptGuidanceFor(commission, { defaultVideoModelId, effectiveVideoMode }));
+ lines.unshift(videoPromptGuidanceFor(commission, { defaultVideoModelId, effectiveVideoMode, effectiveVideoModelId }));
return { goal: composeDirectiveGoal(lines, digest), deliverables: ['One rendered video matching the brief'], constraints };
},
};
@@ -240,12 +242,12 @@ const musicVideoAdapter = {
label: 'Music video',
sanitizeGeneration: (raw) => sanitizeGenerationFor('music-video', raw),
buildProjectParams: buildVideoGeometryParams,
- buildDirective(commission, { defaultVideoModelId, effectiveVideoMode } = {}) {
+ buildDirective(commission, { defaultVideoModelId, effectiveVideoMode, effectiveVideoModelId } = {}) {
const duration = commission?.generation?.durationMode === 'auto'
? ' Choose an appropriate video duration between 5 and 600 seconds for the brief.' : '';
const lead = `Create a short-form music video:${duration} Generate an original music bed AND a matching video scored to it.`;
const { lines, digest, constraints } = briefContext(commission, lead);
- lines.unshift(videoPromptGuidanceFor(commission, { defaultVideoModelId, effectiveVideoMode }));
+ lines.unshift(videoPromptGuidanceFor(commission, { defaultVideoModelId, effectiveVideoMode, effectiveVideoModelId }));
return {
goal: composeDirectiveGoal(lines, digest),
deliverables: ['One original music bed', 'One video matching the brief, scored to the music bed'],
diff --git a/server/services/creativeCommissions/abilityAdapters.test.js b/server/services/creativeCommissions/abilityAdapters.test.js
index ef21e276ca..6ff66177af 100644
--- a/server/services/creativeCommissions/abilityAdapters.test.js
+++ b/server/services/creativeCommissions/abilityAdapters.test.js
@@ -126,6 +126,14 @@ describe('buildCommissionDirective — video (unchanged brief/feedback fold)', (
);
expect(directive.goal).not.toContain('MiniMax H3 prompt template');
});
+
+ it('uses the resolved creative-agent target model before the install default', () => {
+ const directive = buildCommissionDirective(
+ { targetAbility: 'video', brief: { intent: 'a quiet harbor' } },
+ { defaultVideoModelId: () => 'ltx-2.5', effectiveVideoModelId: 'minimax_h3_8bit' },
+ );
+ expect(directive.goal).toContain('MiniMax H3 prompt template');
+ });
});
describe('per-ability directives steer the planner to the right tools', () => {
diff --git a/server/services/creativeCommissions/scheduler.js b/server/services/creativeCommissions/scheduler.js
index 7671313a2c..b7bc065b3c 100644
--- a/server/services/creativeCommissions/scheduler.js
+++ b/server/services/creativeCommissions/scheduler.js
@@ -26,6 +26,7 @@ import { schedule, cancel, isValidCron } from '../eventScheduler.js';
import { getUserTimezone } from '../../lib/timezone.js';
import { getSettings, settingsEvents } from '../settings.js';
import { RENDER_TARGET } from '../../lib/renderTargets.js';
+import { renderTargetDefaults } from '../imageGen/cloudProviderConfig.js';
import { resolveVideoMode, VIDEO_GEN_MODE } from '../videoGen/modes.js';
import { listCommissions, getCommission, recordCommissionRun, commissionEvents } from './store.js';
import { commissionToCron } from './directive.js';
@@ -287,10 +288,14 @@ async function fireCommission(commission, trigger) {
const effectiveVideoMode = (commission.targetAbility === 'video' || commission.targetAbility === 'music-video')
? resolveVideoMode(requestedVideoMode, settings, { target: RENDER_TARGET.CREATIVE_AGENT })
: VIDEO_GEN_MODE.LOCAL;
+ const effectiveVideoModelId = effectiveVideoMode === VIDEO_GEN_MODE.LOCAL
+ ? renderTargetDefaults(settings, RENDER_TARGET.CREATIVE_AGENT).videoModel
+ : null;
const directive = buildCommissionDirective(commission, {
tasteRecipe: startedTasteRecipe,
defaultVideoModelId,
effectiveVideoMode,
+ effectiveVideoModelId,
});
// Fan the commission's single LLM pin onto BOTH CD cognitive stages
// (treatment + plan) as the project's `modelOverrides`, so the scheduled