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: surface LoRA caption-run failures in the dataset workbench UI
[._.]/ Adam Eivy5806a563ae99
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 3cfa2cd0f0..f6cb5bc27d 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -20,6 +20,8 @@- **Concurrent LoRA caption runs no longer fan out parallel requests at a single-GPU backend** — Within one run the captioner already processes images one at a time, but nothing stopped several runs from overlapping (captioning two datasets at once, re-captioning multiple single images, or a double-click). Each run is a detached loop, so concurrent runs fired N parallel `/chat/completions` requests at the same local Ollama/LM Studio — and on one GPU that's pure downside: every Ollama parallel slot reserves its own 32K-token KV cache, so concurrent vision requests multiply VRAM and risk an OOM or model reload, while parallel decoding gives no throughput win (it just time-slices the same compute and makes each request slower). A module-level mutex now serializes every caption vision call across all runs, holding backend load at concurrency 1 regardless of how many runs are in flight. One-shot vision calls (voice `ui_describe_visually`, the vision-test page) stay off the lock so a long batch run can't FIFO-starve an interactive describe. (`server/services/loraDatasetCaption.js`)+- **LoRA caption failures now tell you they happened instead of failing silently** — The captioner already reported per-image failures and a final failure tally over its progress stream (a vision model refusing an image or returning an empty description), but the dataset workbench threw that away: the "Caption all" button just stopped spinning and the run looked done, even when half the images were never captioned. The terminal frame is now surfaced as a toast — an actionable error when the whole run failed up front, a "Captioned 8/10 — 2 images failed (model refused…). Re-caption individually or pick another vision model." summary when some failed, and a success confirmation when all landed. This also covers the per-image "Re-caption" button, whose failures were previously invisible. (`client/src/pages/LoraDatasetDetail.jsx`)+- **LoRA auto-captions no longer silently come back as just the trigger word** — When a vision model returned an empty reply (common when it refuses a realistic close-up face, or when a thinking model spends its whole token budget reasoning), the captioner prefixed that empty string with the trigger word and saved the result — so the image was bound but undescribed, yet the run still logged it as captioned. A blank model reply is now treated as a per-image failure: it's surfaced in the caption run's progress (with the model name and a hint to try a different vision model or caption manually) and never persisted, so the image stays un-captioned and a re-run re-attempts it instead of leaving a degenerate trigger-word-only caption. (`server/services/loraDatasetCaption.js`)- **LoRA caption-model picker now sees vision-capable Ollama models whose name lacks a `vl`/`vision` token** — The picker showed "none installed" even with a vision model like the `qwen3.6:35b` MoE installed, because Ollama's `/api/tags` carries no vision flag and the id heuristic only matches names containing a `vl`/`vision`/known-family token. Ollama *does* report `capabilities: ["…","vision",…]` via `/api/show`, but PortOS only consulted that for LM Studio. `listVisionModels` now enriches each Ollama model the id heuristic doesn't already catch with its `/api/show` capabilities (cached per model, busted on delete), so capability-tagged vision models surface in the picker — and, through the same path, in the captioner's auto-pick and explicit-model validation. (`server/services/ollamaManager.js`, `server/services/localLlm.js`)diff --git a/client/src/pages/LoraDatasetDetail.jsx b/client/src/pages/LoraDatasetDetail.jsxindex 85ad05d04e..7e56aaefbf 100644--- a/client/src/pages/LoraDatasetDetail.jsx+++ b/client/src/pages/LoraDatasetDetail.jsx@@ -176,15 +176,32 @@ export default function LoraDatasetDetail() {return () => clearInterval(timer);}, [renderingCount, refresh]);- // Caption-run SSE — refetch on terminal so captions land in the grid.+ // Caption-run SSE — refetch on terminal so captions land in the grid, and+ // surface failures the run reported. The server emits per-image `error`+ // progress frames and a terminal frame carrying the failure tally+ // (`complete` with `failed`, or `error` when every image failed); without+ // this the run just stops spinning and the user never learns an image was+ // refused / returned an empty description.const captionSseUrl = captionRun ? `/api/lora-datasets/${datasetId}/caption-runs/${captionRun.runId}/events` : null;const captionSse = useSseProgress(captionSseUrl, { enabled: !!captionRun });useEffect(() => {- if (captionRun && captionSse.closed) {- setCaptionRun(null);- refresh();+ if (!captionRun || !captionSse.closed) return;+ const last = captionSse.latest;+ if (last?.type === 'error') {+ // Whole run failed up front (e.g. every image refused) — show the+ // actionable server message verbatim.+ toast.error(last.message || 'Captioning failed');+ } else if (last?.type === 'complete' && last.failed > 0) {+ const noun = last.failed === 1 ? 'image' : 'images';+ toast.error(last.done > 0+ ? `Captioned ${last.done}/${last.total} — ${last.failed} ${noun} failed (model refused or returned an empty description). Re-caption individually or pick another vision model.`+ : `All ${last.failed} ${noun} failed to caption — the vision model refused or returned nothing. Try another vision model.`);+ } else if (last?.type === 'complete' && last.done > 0) {+ toast.success(`Captioned ${last.done} image${last.done === 1 ? '' : 's'}`);}- }, [captionRun, captionSse.closed, refresh]);+ setCaptionRun(null);+ refresh();+ }, [captionRun, captionSse.closed, captionSse.latest, refresh]);const onImagesChange = (mutate) => setDataset((prev) => (prev ? { ...prev, images: mutate(prev.images) } : prev));