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: address review (claude): preserve fallback renders
Adam Eivy95d83e76e71f
diff --git a/client/src/components/fableloom/sceneMediaRequests.js b/client/src/components/fableloom/sceneMediaRequests.jsindex 39f69eee6e..4a40d42be3 100644--- a/client/src/components/fableloom/sceneMediaRequests.js+++ b/client/src/components/fableloom/sceneMediaRequests.js@@ -29,6 +29,7 @@ export const FABLELOOM_CONTINUITY_STRENGTH = 0.4;*/export function findFableLoomPriorImage(episode, nodeId) {const nodes = Array.isArray(episode?.nodes) ? episode.nodes : [];+ if (!nodeId || episode?.startNodeId === nodeId) return null;const predecessor = nodes.find((candidate) => (candidate?.id !== nodeId&& typeof candidate?.image === 'string'diff --git a/client/src/components/fableloom/sceneMediaRequests.test.js b/client/src/components/fableloom/sceneMediaRequests.test.jsindex 64a70805cd..477e0b2625 100644--- a/client/src/components/fableloom/sceneMediaRequests.test.js+++ b/client/src/components/fableloom/sceneMediaRequests.test.js@@ -38,6 +38,24 @@ describe('FableLoom scene media request composition', () => {});});+ it('keeps an opening scene text-to-image when a loop points back to it', () => {+ const opening = { id: 'node-1', imagePrompt: 'the opening shot', transitions: [] };+ const episode = {+ startNodeId: opening.id,+ nodes: [+ opening,+ {+ id: 'node-ending',+ image: 'finale.png',+ transitions: [{ id: 'tr-loop', targetNodeId: opening.id }],+ },+ ],+ };++ expect(buildFableLoomImageRequest({ loom, episode, episodeId: 'ep-1', node: opening }))+ .not.toHaveProperty('initImageFile');+ });+it('builds image-to-video direction from the shared camera vocabulary', () => {expect(buildFableLoomVideoRequest({loom,diff --git a/client/src/pages/FableLoomStory.jsx b/client/src/pages/FableLoomStory.jsxindex 33bba2bfed..4ba7ba4f28 100644--- a/client/src/pages/FableLoomStory.jsx+++ b/client/src/pages/FableLoomStory.jsx@@ -45,6 +45,11 @@ import {weaveLoomEpisode,} from '../services/api';+const CONTINUITY_FALLBACK_CODES = new Set([+ 'IMAGE_EDIT_UNSUPPORTED_MODE',+ 'INIT_IMAGE_NOT_FOUND',+]);+export default function FableLoomStory({ view = 'graph' }) {const { loomId, episodeId, nodeId } = useParams();const navigate = useNavigate();@@ -221,16 +226,33 @@ export default function FableLoomStory({ view = 'graph' }) {}setSceneMediaJob(targetNode.id, 'image', { jobId: null, status: 'submitting', progress: 0 });- const queued = await generateImage(buildFableLoomImageRequest({- loom, episode, episodeId, node: targetNode, stylePreset: sceneStylePreset,- }), { silent: true }).catch((err) => {- setSceneMediaJob(targetNode.id, 'image', {- jobId: null, status: 'failed', progress: 0, error: err.message || 'Could not start the render',- });- toast.error(`Could not start scene image: ${err.message || 'Render request failed'}`);- return null;+ const imageRequest = (includeContinuity) => buildFableLoomImageRequest({+ loom,+ episode: includeContinuity ? episode : null,+ episodeId,+ node: targetNode,+ stylePreset: sceneStylePreset,});+ let continuityFallbackCode = null;+ const queued = await generateImage(imageRequest(true), { silent: true })+ .catch((err) => {+ if (!CONTINUITY_FALLBACK_CODES.has(err.code)) throw err;+ continuityFallbackCode = err.code;+ return generateImage(imageRequest(false), { silent: true });+ })+ .catch((err) => {+ setSceneMediaJob(targetNode.id, 'image', {+ jobId: null, status: 'failed', progress: 0, error: err.message || 'Could not start the render',+ });+ toast.error(`Could not start scene image: ${err.message || 'Render request failed'}`);+ return null;+ });if (!queued) return null;+ if (continuityFallbackCode) {+ toast.warning(continuityFallbackCode === 'INIT_IMAGE_NOT_FOUND'+ ? 'The prior shot image is missing — rendering this scene without continuity conditioning'+ : 'The current image backend cannot use the prior shot — rendering this scene without continuity conditioning');+ }// External SD-API renders synchronously: its generationId identifies the// completed request, not a media-job record. The server has already filed// the image onto the scene, so swap the preview immediately and do notdiff --git a/client/src/pages/FableLoomStory.test.jsx b/client/src/pages/FableLoomStory.test.jsxindex 63b2652265..70e8df125a 100644--- a/client/src/pages/FableLoomStory.test.jsx+++ b/client/src/pages/FableLoomStory.test.jsx@@ -3,7 +3,7 @@ import { render, screen, waitFor } from '@testing-library/react';import { MemoryRouter, Route, Routes } from 'react-router';import userEvent from '@testing-library/user-event';-const toastMocks = vi.hoisted(() => ({ error: vi.fn(), success: vi.fn() }));+const toastMocks = vi.hoisted(() => ({ error: vi.fn(), success: vi.fn(), warning: vi.fn() }));vi.mock('../components/ui/Toast', () => ({ default: toastMocks }));vi.mock('../services/api', () => ({@@ -297,4 +297,42 @@ describe('FableLoomStory scene media lifecycle', () => {fableLoom: { loomId: 'loom-1', episodeId: 'ep-1', nodeId: 'node-2' },}, { silent: true }));});++ it('retries without continuity when the configured backend cannot accept the prior shot', async () => {+ const user = userEvent.setup();+ api.getLoom.mockResolvedValue(loom({+ episodes: [episode({+ nodes: [+ {+ id: 'node-1',+ image: 'threshold.png',+ transitions: [{ id: 'tr-1', targetNodeId: 'node-2', intent: 'Continue' }],+ },+ {+ id: 'node-2',+ imagePrompt: 'the scout enters the observatory',+ transitions: [],+ },+ ],+ })],+ }));+ api.generateImage+ .mockRejectedValueOnce(Object.assign(new Error('Text-to-image only'), {+ code: 'IMAGE_EDIT_UNSUPPORTED_MODE',+ }))+ .mockResolvedValueOnce({ jobId: 'image-job-fallback', status: 'queued' });+ renderEditor();++ await user.click(await screen.findByRole('button', { name: 'Canvas generate second image' }));++ await waitFor(() => expect(api.generateImage).toHaveBeenCalledTimes(2));+ expect(api.generateImage.mock.calls[0][0]).toMatchObject({ initImageFile: 'threshold.png' });+ expect(api.generateImage.mock.calls[1]).toEqual([{+ prompt: 'the scout enters the observatory',+ fableLoom: { loomId: 'loom-1', episodeId: 'ep-1', nodeId: 'node-2' },+ }, { silent: true }]);+ expect(toastMocks.warning).toHaveBeenCalledWith(+ 'The current image backend cannot use the prior shot — rendering this scene without continuity conditioning',+ );+ });});diff --git a/docs/features/fableloom.md b/docs/features/fableloom.mdindex be174f1b83..262a07cb86 100644--- a/docs/features/fableloom.md+++ b/docs/features/fableloom.md@@ -169,6 +169,12 @@ episode order is the deterministic authoring-time source because there is noactive reader path yet. Opening scenes and scenes without a rendered incomingneighbor remain text-to-image.+Continuity conditioning is best-effort for the current stopgap: if the active+backend is text-to-image-only, or the predecessor's gallery file has since been+removed, the editor warns and retries the scene without the init image rather+than blocking production. Canon-locked generation will replace that fallback+with an explicit capability gate in the planned typed-reference workflow.+**Generate video** prefers the node's dedicated single-clip `videoPrompt`, addsthe selected movement's production direction from the shared camera registry,and falls back to scene text for legacy nodes. The registry includes dolly,diff --git a/docs/plans/2026-08-29-fableloom-visual-continuity.md b/docs/plans/2026-08-29-fableloom-visual-continuity.mdindex 7c5c5c82dd..000c787dc9 100644--- a/docs/plans/2026-08-29-fableloom-visual-continuity.md+++ b/docs/plans/2026-08-29-fableloom-visual-continuity.md@@ -246,6 +246,9 @@ the recorded manifest and refuses if an asset has been removed. This keeps- Condition a scene image on the first rendered direct predecessor.- Use graph edges, exclude self-loops, and leave openings text-to-image.+- Warn and retry text-to-image when the backend cannot edit or the predecessor+ file is stale, preserving the existing render path until typed capability+ checks land.- Cover request composition and the editor-to-API boundary.### Phase 1 — structured visual bindings and compiler