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(media): remove redundant models refresh control

Adam Eivy890b84ccbfbc
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 45e584cc3b..1e91ca6525 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -22,6 +22,7 @@
## Changed
+- Media Gen Models now opens directly on model storage details without the redundant manual refresh control; cached model data still reloads on page load.
- **Image Gen and Video Gen layouts tightened for above-the-fold density.** Form and preview now render side-by-side on wider screens instead of stacking, so more of the page is usable without scrolling. Previews are capped so they no longer dominate the viewport, the prompt and negative-prompt fields sit in two columns on medium+ screens, and section headers are more compact. Status text is hoisted into the Generate button row; video Download moved into the preview header for parity with Image Gen.
- **Worktree policy clarified** in developer documentation: TUI sessions edit the main repo directly; worktrees are reserved for unattended CoS sub-agents.
- Video Gen frame picker now goes up to 481 frames (~20s at 24fps); options past 241 frames (~10s) show a hint recommending Extend mode for reliable long renders at 48 GB.
@@ -35,6 +36,7 @@
## Fixed
+- CoS service initialization now recognizes Vitest runs and skips eager daemon startup during server unit tests, avoiding circular-import side effects.
- **Creative Director stuck projects now self-recover** — the orchestrator re-evaluates project state after every task completes, so projects that were started before the treatment/evaluate workflow split no longer get frozen. Manually accepting or failing a scene also immediately triggers the next scene to start.
- **Creative Director projects auto-resume on server restart.** Previously a server restart mid-render left a project frozen — the scene appeared to be rendering but had no active job behind it, and the orchestrator wouldn't kick off a replacement because of bookkeeping left behind by the dead worker. On boot, any in-progress Creative Director project now detects interrupted scenes, clears the stale bookkeeping, and resumes from exactly where it left off.
- **Creative Director smoke test** — a "Run smoke test" button on the Creative Director list page creates a deterministic 3-scene project (red ball → blue ball continuation → pure continuity) to verify the full pipeline end-to-end without needing a real story or AI evaluation. The smoke test skips audio generation and auto-accepts every scene so it completes in render time only, making it a fast sanity check after setup or after a model swap.
diff --git a/client/src/components/writers-room/WorkEditor.jsx b/client/src/components/writers-room/WorkEditor.jsx
index b12cff8f7d..e9a13892cf 100644
--- a/client/src/components/writers-room/WorkEditor.jsx
+++ b/client/src/components/writers-room/WorkEditor.jsx
@@ -67,7 +67,7 @@ function readSidebarWidth() {
}
function persistSidebarWidth(width) {
- try { window.localStorage.setItem(SIDEBAR_WIDTH_KEY, String(Math.round(width))); } catch {}
+ try { window.localStorage.setItem(SIDEBAR_WIDTH_KEY, String(Math.round(width))); } catch { return undefined; }
}
function readSidebarTab() {
@@ -389,7 +389,7 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseO
const toggleReadingTheme = useCallback(() => {
setReadingTheme((prev) => {
const next = prev === 'dark' ? 'light' : 'dark';
- try { window.localStorage.setItem(READING_THEME_KEY, next); } catch {}
+ try { window.localStorage.setItem(READING_THEME_KEY, next); } catch { return next; }
return next;
});
}, []);
@@ -637,4 +637,3 @@ function VersionsList({ work, dirty, onSwitch }) {
</>
);
}
-
diff --git a/client/src/pages/MediaModels.jsx b/client/src/pages/MediaModels.jsx
index c1d565315d..d4ccb1dede 100644
--- a/client/src/pages/MediaModels.jsx
+++ b/client/src/pages/MediaModels.jsx
@@ -8,21 +8,18 @@
*/
import { useState, useEffect, useCallback } from 'react';
-import { Trash2, RefreshCw, Image as ImageIcon, Film } from 'lucide-react';
+import { Trash2, Image as ImageIcon, Film } from 'lucide-react';
import toast from '../components/ui/Toast';
import { listCachedModels, deleteCachedModel, deleteLora } from '../services/api';
export default function MediaModels() {
const [data, setData] = useState({ models: [], loras: [], hubDir: '', diskUsage: {} });
- const [loading, setLoading] = useState(true);
const [busy, setBusy] = useState(null);
const refresh = useCallback(() => {
- setLoading(true);
listCachedModels()
.then(setData)
- .catch(() => setData({ models: [], loras: [], hubDir: '', diskUsage: {} }))
- .finally(() => setLoading(false));
+ .catch(() => setData({ models: [], loras: [], hubDir: '', diskUsage: {} }));
}, []);
useEffect(() => { refresh(); }, [refresh]);
@@ -55,17 +52,6 @@ export default function MediaModels() {
return (
<div className="space-y-6">
- <div className="flex items-center justify-end gap-2">
- <button
- onClick={refresh}
- disabled={loading}
- className="p-2 rounded-lg text-gray-400 hover:text-white hover:bg-port-border/50 disabled:opacity-50 min-h-[40px] min-w-[40px] flex items-center justify-center"
- title="Refresh"
- >
- <RefreshCw className={`w-4 h-4 ${loading ? 'animate-spin' : ''}`} />
- </button>
- </div>
-
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
{Object.entries(data.diskUsage || {}).map(([key, value]) => (
<div key={key} className="bg-port-card border border-port-border rounded-xl p-4">
diff --git a/server/services/cos.js b/server/services/cos.js
index afc76a28dc..e594407efa 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -3066,6 +3066,6 @@ async function init() {
// Initialize asynchronously — vitest sets NODE_ENV=test by default, so this
// skips eager init (and its listeners/timers) in unit tests and avoids
// circular-import side effects.
-if (process.env.NODE_ENV !== 'test') {
+if (process.env.NODE_ENV !== 'test' && process.env.VITEST !== 'true') {
init();
}