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

address review (claude): guard progress bar against NaN, document residual terminal progress

[._.]/ Adam Eivya268394244a4
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsx
index 8dc971d62f..f65512882b 100644
--- a/client/src/components/media/MediaJobsQueue.jsx
+++ b/client/src/components/media/MediaJobsQueue.jsx
@@ -191,7 +191,9 @@ function JobRow({ job, onCancel, onRetry, onRunNow, onDelete }) {
// Run-now is codex-only — GPU jobs serialize on the single MLX runtime.
const isQueuedCodex = job.status === 'queued' && job.kind === 'image' && job.params?.mode === IMAGE_GEN_MODE.CODEX;
const canRunNow = isQueuedCodex && typeof onRunNow === 'function';
- const progressPct = typeof job.progress === 'number'
+ // Number.isFinite (not typeof === 'number') so a NaN from a hand-edited
+ // media-jobs.json can't render as `NaN%` / `width: NaN%`.
+ const progressPct = Number.isFinite(job.progress)
? Math.max(0, Math.min(100, Math.round(job.progress * 100)))
: 0;
// Inline edit form for retry-with-overrides.
diff --git a/server/services/mediaJobQueue/index.js b/server/services/mediaJobQueue/index.js
index 972b8a045a..cceedb0c77 100644
--- a/server/services/mediaJobQueue/index.js
+++ b/server/services/mediaJobQueue/index.js
@@ -564,6 +564,9 @@ async function runJob(job) {
job.progress = 1;
job.statusMsg = 'Completed';
}
+ // failed/canceled intentionally retain the last mid-render progress/statusMsg
+ // (how far it got) — consumers gate the progress UI on status === 'running',
+ // so the residual values are not displayed for terminal jobs.
job.completedAt = new Date().toISOString();
const logPrefix = state === 'completed' ? '✅' : state === 'canceled' ? '🛑' : '❌';
const logSuffix = state === 'failed' ? `: ${job.error}` : state === 'canceled' ? ' (was running)' : '';