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
address review: fix queue and UI edge cases
Adam Eivy4245b55e255a
diff --git a/client/src/components/cos/CoSBackgroundCamera.jsx b/client/src/components/cos/CoSBackgroundCamera.jsxindex b2c488542e..6ca534e50c 100644--- a/client/src/components/cos/CoSBackgroundCamera.jsx+++ b/client/src/components/cos/CoSBackgroundCamera.jsx@@ -10,14 +10,14 @@ export default function CoSBackgroundCamera({ enabled = false, x = 0, y = 0, z =useEffect(() => {if (!enabled) return;- const oldFrameHeight = window.innerWidth >= 1024+ const oldFrameHeight = size.width >= 1024? DESKTOP_FRAME_HEIGHT: COMPACT_FRAME_HEIGHT;const distanceScale = Math.max(1, size.height / oldFrameHeight);camera.position.set(x, y, z * distanceScale);camera.updateProjectionMatrix();- }, [camera, enabled, size.height, x, y, z]);+ }, [camera, enabled, size.height, size.width, x, y, z]);return null;}diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsxindex 1540c55b86..98e2c561c5 100644--- a/client/src/components/cos/TaskAddForm.jsx+++ b/client/src/components/cos/TaskAddForm.jsx@@ -6,6 +6,13 @@ import * as api from '../../services/api';import { processScreenshotUploads, processAttachmentUploads } from '../../utils/fileUpload';import { formatBytes } from '../../utils/formatters';+const isCodexProvider = (provider) => {+ if (!provider) return false;+ if (provider.id === 'codex') return true;+ const commandName = String(provider.command || '').split(/[\\/]/).pop().replace(/\.(exe|cmd|bat)$/i, '');+ return commandName === 'codex';+};+export default function TaskAddForm({ providers, apps, onTaskAdded, compact = false, defaultExpanded = false, defaultApp = '' }) {const [newTask, setNewTask] = useState({ description: '', model: '', provider: '', app: defaultApp });const [addToTop, setAddToTop] = useState(false);@@ -65,7 +72,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = faconst selectedProvider = providers?.find(p => p.id === newTask.provider);const availableModels = selectedProvider?.models || [];const providerModelNote = selectedProvider- ? selectedProvider.command === 'codex'+ ? isCodexProvider(selectedProvider)? 'Codex uses the model configured in ~/.codex/config.toml.': selectedProvider.type === 'cli'? `${selectedProvider.name} uses its CLI configured default model.`diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex b9170b91be..51feb70a9f 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -87,6 +87,13 @@ const newQueueId = () =>? crypto.randomUUID(): `q-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;+const videoModelMemoryGb = (model) => {+ const explicit = Number(model?.memoryGb);+ if (Number.isFinite(explicit) && explicit > 0) return explicit;+ const match = String(model?.name || '').match(/~\s*(\d+(?:\.\d+)?)\s*GB/i);+ return match ? Number(match[1]) : Number.POSITIVE_INFINITY;+};+const ImagePreview = ({ src, alt, label }) => (<div className="space-y-1"><img src={src} alt={alt} className="w-full max-h-48 object-contain rounded border border-port-border bg-port-bg" />@@ -360,12 +367,14 @@ export default function VideoGen() {setDisableAudio(false);setNoMusic(false);setChunks(1);- // Auto-select the smallest (first) ltx2-runtime model so the user+ // Auto-select the lowest-memory ltx2-runtime model so the user// doesn't land on a blocked state. Only fires when the current model// can't handle a2v — if they already have a dgrauet model selected// we leave it alone.if (currentModel?.runtime !== 'ltx2') {- const ltx2Model = models.find((m) => m.runtime === 'ltx2');+ const ltx2Model = models+ .filter((m) => m.runtime === 'ltx2')+ .sort((a, b) => videoModelMemoryGb(a) - videoModelMemoryGb(b))[0];if (ltx2Model) setModelId(ltx2Model.id);}}diff --git a/server/routes/imageGen.js b/server/routes/imageGen.jsindex 07e510b713..57a63d44be 100644--- a/server/routes/imageGen.js+++ b/server/routes/imageGen.js@@ -152,6 +152,9 @@ router.post('/generate', initImageUpload, asyncHandler(async (req, res) => {// Strip the route-only `initImageFile` field — providers expect `initImagePath`.delete data.initImageFile;if (initImagePath) data.initImagePath = initImagePath;+ if (data.guidance == null && data.cfgScale != null) {+ data.guidance = data.cfgScale;+ }// Multer's tmp upload is no longer needed once we've copied it into// PATHS.images. Use res.on('close') so the temp file is cleaned up whetherdiff --git a/server/routes/imageGen.test.js b/server/routes/imageGen.test.jsindex 934330b67a..bda8059618 100644--- a/server/routes/imageGen.test.js+++ b/server/routes/imageGen.test.js@@ -164,6 +164,21 @@ describe('Image Gen Routes', () => {expect(imageGen.generateImage).not.toHaveBeenCalled();});+ it('local mode maps cfgScale to guidance before enqueueing', async () => {+ getSettings.mockResolvedValueOnce({ imageGen: { mode: 'local', local: { pythonPath: '/usr/bin/python3' } } });+ mediaJobQueue.enqueueJob.mockReturnValueOnce({ jobId: 'queued-job-cfg', position: 1, status: 'queued' });++ const response = await request(app)+ .post('/api/image-gen/generate')+ .send({ prompt: 'a fox in a forest', cfgScale: 6.5 });++ expect(response.status).toBe(200);+ expect(mediaJobQueue.enqueueJob).toHaveBeenCalledWith(expect.objectContaining({+ kind: 'image',+ params: expect.objectContaining({ cfgScale: 6.5, guidance: 6.5 }),+ }));+ });+// The per-request `mode` override flips into queue mode even when the// saved default is external — protects against future regressions where// someone hard-codes settings.imageGen.mode as the only mode source.diff --git a/server/services/videoGen/local.js b/server/services/videoGen/local.jsindex 32f1b5e99e..1ea71f3f9c 100644--- a/server/services/videoGen/local.js+++ b/server/services/videoGen/local.js@@ -263,7 +263,7 @@ const buildArgs = ({ pythonPath, modelId, model, prompt, negativePrompt, width,return { bin: pythonPath, args };};-export async function generateVideo({ pythonPath, prompt, negativePrompt = '', modelId = defaultVideoModelId(), width = 768, height = 512, numFrames = 121, fps = 24, steps, guidanceScale, seed, tiling = 'auto', disableAudio = false, sourceImagePath = null, uploadedTempPath = null, uploadedTempPaths = [], lastImagePath = null, extendFromVideoPath = null, audioFilePath = null, mode = null, imageStrength = null, jobId: providedJobId = null }) {+export async function generateVideo({ pythonPath, prompt, negativePrompt = '', modelId = defaultVideoModelId(), width = 768, height = 512, numFrames = 121, fps = 24, steps, guidanceScale, seed, tiling = 'auto', disableAudio = false, sourceImagePath = null, uploadedTempPath = null, uploadedTempPaths = [], lastImagePath = null, extendFromVideoPath = null, audioFilePath = null, mode = null, imageStrength = null, hidden = false, jobId: providedJobId = null }) {uploadedTempPaths = Array.isArray(uploadedTempPaths) ? uploadedTempPaths : [];if (!pythonPath) throw new ServerError('Python path not configured — set it in Settings > Image Gen', { status: 400, code: 'VIDEO_GEN_NOT_CONFIGURED' });if (!prompt?.trim()) throw new ServerError('Prompt is required', { status: 400, code: 'VALIDATION_ERROR' });@@ -335,7 +335,21 @@ export async function generateVideo({ pythonPath, prompt, negativePrompt = '', m? await resizeImage(lastImagePath, 'last'): { resolved: lastImagePath, tempPath: null };- const meta = { id: jobId, prompt, negativePrompt, modelId, seed: actualSeed, width: w, height: h, numFrames: parsedNumFrames, fps: parsedFps, filename, createdAt: new Date().toISOString(), mode: mode || (sourceImagePath ? 'image' : 'text') };+ const meta = {+ id: jobId,+ prompt,+ negativePrompt,+ modelId,+ seed: actualSeed,+ width: w,+ height: h,+ numFrames: parsedNumFrames,+ fps: parsedFps,+ filename,+ createdAt: new Date().toISOString(),+ mode: mode || (sourceImagePath ? 'image' : 'text'),+ ...(hidden ? { hidden: true } : {}),+ };const job = { ...meta, clients: [], status: 'running' };jobs.set(jobId, job);@@ -580,6 +594,7 @@ export async function generateChainedVideo({ chunks, jobId: outerJobId, ...rest// prior render, which lives under data/images.uploadedTempPath: i === 0 ? rest.uploadedTempPath : null,uploadedTempPaths: i === 0 ? (rest.uploadedTempPaths || []) : [],+ hidden: true,mode: i === 0 ? firstMode : 'image',// After the first chunk, drop FFLF-style last image — chained continuation// is single-conditioned on the previous chunk's tail frame.