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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: carry a commission's video backend pin across the teaser project boundary
[._.]/ Adam Eivyb146ac7c5a63
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 87f1995dfe..b7d8c53bb4 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -61,6 +61,7 @@## Fixed- **A creative commission pinned to Grok now actually renders on Grok.** Commissions have been able to name their video backend — Grok, or local with a specific local video model — for a while, but the pin only reached renders the Creative Director's *planner* queued. The scene-by-scene render path, which is where a commission's video is actually produced, never read it: every scene went to the local MLX runtime regardless, the pinned local model was ignored in favor of the project's creation-time default, and an install with no local Python configured failed the whole project up front even when Grok was the configured, enabled, pinned backend. Both paths now resolve the backend through one shared ladder — the commission's own pin, then the install-wide Creative Agent render default, then the global video pin — so what the form says is what renders. Grok's 6s/10s-only clip lengths are covered by rounding a scene's duration up rather than letting it silently come back short, and the project's aspect ratio carries through to Grok's base image. A pin naming a backend whose toggle has since been switched off still degrades to local rather than failing a nightly run, and if local is unconfigured too, the scene now says the pinned backend is disabled instead of only asking for a Python path.+- **A commission's video backend now survives the teaser hand-off, and its pinned local model reaches the planner.** Two leaks were left after the render paths were unified. First, when a commission's plan reaches for "produce a teaser from this issue," that tool mints a *separate* Creative Director project — and it was minted unpinned, so the run's actual deliverable rendered on the install default while the commission said Grok. The teaser now inherits the calling project's backend pin and video model; the pin is read from the project record rather than exposed to the planner, so the model writing the plan cannot pick a render backend of its own. Second, a pinned local video model was stored only on the commission's backend pin, leaving the project's own model on the install default — which is the value the Creative Director's planner prompt reports to the model, so the plan was written against a model that was never going to render it. The chosen video model is now the project's model too. A commission that pins nothing still behaves exactly as before.- **[issue-3728] The Antigravity code reviewer can finally be pinned to a model, not just an effort.** Every reviewer row offered Antigravity an Effort cell and then told you it "takes no model" — but `agy --model <id>` is real (PortOS already passes it for its own Antigravity runs, and slashdo accepts an `antigravity[<model>]` selector), so the reviewer was silently left on agy's own default, which can be a slow Thinking tier. Antigravity now gets a Model cell everywhere the reviewer picker appears — Code Review Defaults, the task form, the CoS schedule tab, and the slashdo run drawer — populated from agy's installed catalog and free-text so a tier newer than the stored snapshot still works. Because agy lists each reasoning tier as its own model id (`gemini-3.6-flash-high`) while the row already has an Effort control, the picker offers the base ids and PortOS splits a suffixed id you type back into `--model <base> --effort <tier>`, which is the pair agy actually accepts; an effort you picked yourself always wins over the one baked into the id.- **A note that iCloud wrongly reports as "not downloaded" can now be saved anyway.** The write guard screens for an offloaded note by looking for a real byte length with no local blocks — a shape an ordinary sparse or compressed file also has. When that misfired the lockout was permanent: asking iCloud to download an already-local file succeeds instantly and changes nothing, so every save was refused forever while the message told the user to try again shortly. The server now checks whether the download both succeeded and actually moved the file, so it can tell a download still in flight (or one that failed) from a refusal that will never clear — and only the second of those, twice in a row on the same note, offers the Brain Notes and Wiki editors a deliberate "Save anyway" row that writes it regardless. While a download really is in flight you still just wait, and the ordinary Save button, ⌘S, and background mirrors always refuse, so nothing bypasses the guard without an explicit click. The message no longer says to try again shortly when trying again cannot help.- **Quiet Codex reasoning is no longer mistaken for a finished one-shot response.** The TUI runner's eight-second screen-idle fallback could kill an active long-form Luna or Sol stage between status repaints, then hand terminal chrome such as `[Pasted Content …]` to a JSON parser as if it were the model's answer. Codex one-shot calls now wait for their required response file, a natural exit, explicit cancellation, or the configured hard cap; inline idle completion remains available for other TUIs that do not honor file output.diff --git a/client/src/components/creative-commission/CommissionConfigForm.jsx b/client/src/components/creative-commission/CommissionConfigForm.jsxindex c432367af2..eb20474717 100644--- a/client/src/components/creative-commission/CommissionConfigForm.jsx+++ b/client/src/components/creative-commission/CommissionConfigForm.jsx@@ -344,7 +344,9 @@ function RenderBackendSection({ ability, generation, patchForm }) {<h3 className="text-sm font-semibold text-gray-200">Render backend</h3><p className="text-xs text-gray-500">Which backend actually renders each run. Leave on <strong className="text-gray-400">Auto</strong> to- follow your install's Image Gen default.+ follow your install's Settings → Image Gen defaults. Pin{' '}+ <strong className="text-gray-400">Local</strong> to also choose the model each render uses; the cloud+ backends pick their own.</p><div className="grid grid-cols-1 sm:grid-cols-2 gap-3">{fields.map((field) => {diff --git a/server/services/creative/tools/cd.js b/server/services/creative/tools/cd.jsindex 15b18c53be..960d16175b 100644--- a/server/services/creative/tools/cd.js+++ b/server/services/creative/tools/cd.js@@ -8,8 +8,34 @@import { z } from 'zod';import { produceVideoFromIssue } from '../../creativeDirector/bridgeFromIssue.js';+import { getProject } from '../../creativeDirector/local.js';import { COST_LLM } from './shared.js';+/**+ * The calling project's render pin (#3135), inherited by the teaser this tool+ * mints. A creative commission stamps its `generation.videoMode`/`.videoModelId`+ * onto the project it runs in (creativeCommissions/abilityAdapters.js), but the+ * teaser is a SEPARATE project — without this the pin stops at that boundary and+ * the teaser renders on the install default.+ *+ * Deliberately NOT in the tool schema: the planner LLM must not be able to pick+ * a render backend. The pin is the user's configured choice, so it's read from+ * the project record and spread UNDER the parsed args, which carry no+ * `renderBackend`/`modelId` keys for the model to override it with.+ *+ * Best-effort — a project-less dispatch or an unreadable record just means "no+ * inherited pin", the same as before pins existed.+ */+async function inheritedRenderSettings(ctx) {+ if (!ctx?.projectId) return {};+ const project = await getProject(ctx.projectId).catch(() => null);+ if (!project) return {};+ return {+ ...(project.renderBackend ? { renderBackend: project.renderBackend } : {}),+ ...(project.modelId ? { modelId: project.modelId } : {}),+ };+}+export const CD_TOOLS = [{name: 'cd_produceVideoFromIssue',@@ -36,6 +62,7 @@ export const CD_TOOLS = [},required: ['issueId'],},- execute: ({ issueId, ...options }) => produceVideoFromIssue(issueId, options),+ execute: async ({ issueId, ...options }, ctx) =>+ produceVideoFromIssue(issueId, { ...await inheritedRenderSettings(ctx), ...options }),},];diff --git a/server/services/creative/tools/cd.test.js b/server/services/creative/tools/cd.test.jsnew file mode 100644index 0000000000..1411a653ee--- /dev/null+++ b/server/services/creative/tools/cd.test.js@@ -0,0 +1,69 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';++// `cd_produceVideoFromIssue` mints a SEPARATE CD project, so the calling+// project's render pin (#3135 — what a creative commission stamps its video+// backend onto) has to be handed across that boundary explicitly. Without it a+// commission pinned to Grok would render its teaser on the install default.+vi.mock('../../creativeDirector/bridgeFromIssue.js', () => ({+ produceVideoFromIssue: vi.fn(async () => ({ project: { id: 'cd-2' }, proposal: {} })),+}));+vi.mock('../../creativeDirector/local.js', () => ({ getProject: vi.fn(async () => null) }));++import { produceVideoFromIssue } from '../../creativeDirector/bridgeFromIssue.js';+import { getProject } from '../../creativeDirector/local.js';+import { CD_TOOLS } from './cd.js';++const tool = CD_TOOLS.find((t) => t.name === 'cd_produceVideoFromIssue');+const run = (args, ctx = {}) => tool.execute(args, ctx);+const options = () => produceVideoFromIssue.mock.calls.at(-1)[1];++beforeEach(() => {+ vi.clearAllMocks();+ getProject.mockResolvedValue(null);+});++describe('cd_produceVideoFromIssue — render pin inheritance', () => {+ it('passes no pin when the tool runs outside a project context', async () => {+ await run({ issueId: 'iss-1' });+ expect(getProject).not.toHaveBeenCalled();+ expect(options()).toEqual({});+ });++ it("inherits the calling project's video pin and model", async () => {+ getProject.mockResolvedValue({ id: 'cd-1', modelId: 'wan-2.2', renderBackend: { video: { mode: 'grok' } } });+ await run({ issueId: 'iss-1' }, { projectId: 'cd-1' });+ expect(options()).toEqual({ renderBackend: { video: { mode: 'grok' } }, modelId: 'wan-2.2' });+ });++ it('an unpinned calling project contributes nothing (byte-identical to before)', async () => {+ getProject.mockResolvedValue({ id: 'cd-1' });+ await run({ issueId: 'iss-1' }, { projectId: 'cd-1' });+ expect(options()).toEqual({});+ });++ it('an unreadable project degrades to no inherited pin rather than failing the step', async () => {+ getProject.mockRejectedValue(new Error('store down'));+ await run({ issueId: 'iss-1' }, { projectId: 'cd-1' });+ expect(options()).toEqual({});+ });++ it('the LLM-authored args still win over the inherited geometry', async () => {+ getProject.mockResolvedValue({ id: 'cd-1', renderBackend: { video: { mode: 'grok' } } });+ await run({ issueId: 'iss-1', quality: 'high' }, { projectId: 'cd-1' });+ expect(options()).toEqual({ renderBackend: { video: { mode: 'grok' } }, quality: 'high' });+ });++ it('the planner cannot author a backend of its own — the schema drops those keys', async () => {+ // The pin is the USER's configured choice. `execute` spreads the parsed args+ // over the inherited pin, so the only thing keeping the LLM from overriding+ // it is that the schema carries no renderBackend/modelId key at all.+ const parsed = tool.schema.parse({+ issueId: 'iss-1', renderBackend: { video: { mode: 'local' } }, modelId: 'attacker-model',+ });+ expect(parsed).toEqual({ issueId: 'iss-1' });++ getProject.mockResolvedValue({ id: 'cd-1', modelId: 'wan-2.2', renderBackend: { video: { mode: 'grok' } } });+ await run(parsed, { projectId: 'cd-1' });+ expect(options()).toEqual({ renderBackend: { video: { mode: 'grok' } }, modelId: 'wan-2.2' });+ });+});diff --git a/server/services/creativeCommissions/abilityAdapters.js b/server/services/creativeCommissions/abilityAdapters.jsindex 533c83e07c..c8547783e3 100644--- a/server/services/creativeCommissions/abilityAdapters.js+++ b/server/services/creativeCommissions/abilityAdapters.js@@ -134,7 +134,14 @@ function buildVideoGeometryParams(commission, { defaultVideoModelId } = {}) {return {aspectRatio: gen?.aspectRatio || '16:9',quality: gen?.quality || 'standard',- modelId: gen?.model || (typeof defaultVideoModelId === 'function' ? defaultVideoModelId() : undefined),+ // The project's video model. `videoModelId` is the pin the UI actually sets+ // (Render backend → "Local video model"), and it wins over the legacy+ // universal `generation.model`. Without this the user's chosen model reached+ // the render only via `renderBackend.video.modelId`, leaving `project.modelId`+ // on the install default — which the CD planner prompt reports to the LLM+ // (lib/creativeDirectorPrompts.js) and the teaser tool inherits. Neither set+ // ⇒ the install default, exactly as before.+ modelId: gen?.videoModelId || gen?.model || (typeof defaultVideoModelId === 'function' ? defaultVideoModelId() : undefined),targetDurationSeconds: gen?.targetDurationSeconds || 10,// Only passed when the commission actually pinned a backend (#3135), so an// unpinned commission's createProject call is byte-identical to a hand-madediff --git a/server/services/creativeCommissions/abilityAdapters.test.js b/server/services/creativeCommissions/abilityAdapters.test.jsindex 738ccb2863..ad675d510a 100644--- a/server/services/creativeCommissions/abilityAdapters.test.js+++ b/server/services/creativeCommissions/abilityAdapters.test.js@@ -154,6 +154,19 @@ describe('buildProjectParams — every type yields well-formed render settings',expect(p).toEqual({ aspectRatio: '1:1', quality: 'draft', modelId: 'ltx-default', targetDurationSeconds: 15 });});+ it('the pinned local video model becomes the project model', () => {+ // `project.modelId` is what the CD planner prompt reports to the LLM and what+ // the teaser tool inherits, so a videoModelId that stopped at+ // `renderBackend.video.modelId` would leave both on the install default.+ const p = getAbilityAdapter('video').buildProjectParams({ generation: { videoMode: 'local', videoModelId: 'wan-2.2' } }, ctx);+ expect(p.modelId).toBe('wan-2.2');+ });++ it('falls back to the legacy universal model, then the install default', () => {+ expect(getAbilityAdapter('video').buildProjectParams({ generation: { model: 'ltx-13b' } }, ctx).modelId).toBe('ltx-13b');+ expect(getAbilityAdapter('video').buildProjectParams({ generation: {} }, ctx).modelId).toBe('ltx-default');+ });+it('non-video types still carry harmless geometry defaults', () => {for (const ability of ['image', 'music', 'series']) {const p = getAbilityAdapter(ability).buildProjectParams({ generation: {} }, ctx);diff --git a/server/services/creativeDirector/bridgeFromIssue.js b/server/services/creativeDirector/bridgeFromIssue.jsindex 22f887613e..8caef82e1c 100644--- a/server/services/creativeDirector/bridgeFromIssue.js+++ b/server/services/creativeDirector/bridgeFromIssue.js@@ -75,7 +75,8 @@ function deriveTeaserBrief(series, issue, proposal) {** @param {string} issueId* @param {{ providerDefault?: string, modelDefault?: string, effortDefault?: string, name?: string,- * aspectRatio?: string, quality?: string, targetDurationSeconds?: number }} [options]+ * aspectRatio?: string, quality?: string, targetDurationSeconds?: number, modelId?: string,+ * renderBackend?: object }} [options]* @returns {Promise<{ project: object, proposal: object }>}*/export async function produceVideoFromIssue(issueId, options = {}) {@@ -125,10 +126,17 @@ export async function produceVideoFromIssue(issueId, options = {}) {name: options.name || `${issue.title || series?.name || 'Issue'} — Teaser`,aspectRatio: options.aspectRatio || '16:9',quality: options.quality || 'standard',- modelId: defaultVideoModelId(),+ modelId: options.modelId || defaultVideoModelId(),targetDurationSeconds: options.targetDurationSeconds || 60,styleSpec: proposal.styleSpec || '',sourceIssueId: issueId,+ // Carry the caller's render-backend pin (#3135) onto the teaser. The teaser+ // is a SEPARATE CD project, so a creative commission that reaches this tool+ // from its plan would otherwise render the run's actual deliverable on the+ // install default while the commission says "Grok" — silently defeating the+ // pin at the project boundary. Absent ⇒ null, i.e. today's behavior for the+ // manual writers-room / pipeline send paths.+ renderBackend: options.renderBackend || null,});let started;diff --git a/server/services/creativeDirector/bridgeFromIssue.test.js b/server/services/creativeDirector/bridgeFromIssue.test.jsindex a262d6155a..cde3d4a79a 100644--- a/server/services/creativeDirector/bridgeFromIssue.test.js+++ b/server/services/creativeDirector/bridgeFromIssue.test.js@@ -124,4 +124,23 @@ describe('produceVideoFromIssue (#2185)', () => {const stageOpts = mockRunStagedLLM.mock.calls[0][2];expect(stageOpts).toMatchObject({ providerDefault: 'anthropic', modelDefault: 'opus' });});++ it('carries the caller\'s render-backend pin and video model onto the teaser (#3135)', async () => {+ // The teaser is the deliverable when a creative commission's plan reaches+ // this tool — minting it unpinned would render on the install default while+ // the commission says "Grok".+ await produceVideoFromIssue('iss-1', {+ renderBackend: { video: { mode: 'grok' } },+ modelId: 'wan-2.2',+ });+ expect(mockCreateProject.mock.calls[0][0]).toMatchObject({+ renderBackend: { video: { mode: 'grok' } },+ modelId: 'wan-2.2',+ });+ });++ it('mints an unpinned teaser on the install default when no caller pins one', async () => {+ await produceVideoFromIssue('iss-1');+ expect(mockCreateProject.mock.calls[0][0]).toMatchObject({ renderBackend: null, modelId: 'ltx-model' });+ });});