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
Don't bench a provider on model-not-found (request-specific bad model id)
[._.]/ Adam Eivyda8583cf3ee4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 70cfc368fa..3e15703058 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,7 +2,7 @@## Added-- **Enrich a Universe noun — and refine a Universe style — from a reference image.** The Universe Bible's "Describe from image" modal now takes reference images from your **gallery** as well as uploads, and for **characters** it can do more than write the descriptor paragraph: a new **Build character details** action has a vision model read the reference image(s) and *propose* values for the character's still-blank structured fields (pronouns, age, visual notes, color palette, expressions, …). The proposals are shown for review — uncheck any, edit the text inline — and applied through the normal entry-patch path, so existing values are never overwritten (no-clobber, characters-only). Separately, the **Refine Prompts** form gains an optional **style-reference image**: pick one from the gallery and the refiner runs through a vision-capable provider, folding the image's palette/lighting/mood into the universe's `influences` + `styleNotes`. Both vision paths require an API provider with a vision model and reject a silent fallback to a non-vision provider rather than hallucinating from text alone. (`server/services/universeVisionExpand.js`, `server/services/universeBuilderRefine.js`, `server/routes/universeBuilder.js`, `client/src/components/universe/VisionDescribeModal.jsx`, `client/src/pages/UniverseBuilder.jsx`)+- **Enrich a Universe noun — and refine a Universe style — from a reference image.** The Universe Bible's "Describe from image" modal now takes reference images from your **gallery** as well as uploads, and for **characters** it can do more than write the descriptor paragraph: a new **Build character details** action has a vision model read the reference image(s) and *propose* values for the character's still-blank structured fields (pronouns, age, visual notes, color palette, expressions, …). The proposals are shown for review — uncheck any, edit the text inline — and applied through the normal entry-patch path, so existing values are never overwritten (no-clobber, characters-only). Separately, the **Refine Prompts** form gains an optional **style-reference image**: pick one from the gallery and the refiner runs through a vision-capable provider, folding the image's palette/lighting/mood into the universe's `influences` + `styleNotes`. Both vision paths require an API provider with a vision model and reject a silent fallback to a non-vision provider rather than hallucinating from text alone; the vision provider/model pickers scope local (Ollama/LM Studio) backends to vision-capable models. Relatedly, a **model-not-found error no longer benches the whole provider** — that's a bad model id in one request, not a provider outage, so (like a content refusal) the single call still falls back but the provider stays available for its other working models (previously one bad model id could take Ollama offline for 30 minutes). (`server/services/universeVisionExpand.js`, `server/services/universeBuilderRefine.js`, `server/routes/universeBuilder.js`, `server/lib/promptRunner.js`, `client/src/components/universe/VisionDescribeModal.jsx`, `client/src/pages/UniverseBuilder.jsx`)- **[issue-1300] Editorial checks flag five prose anti-patterns (weak openings, mirror self-description, empty pleasantries, italic thoughts, darlings).** A bundle of line/scene-level checks (Create → Editorial Checks) for the well-known tells that pull readers out. Four are LLM checks over the drafted manuscript: **Weak opening** flags clichéd or mis-placed openers — "he wakes up" / alarm-clock / dream starts, weather-and-scenery preambles, and scenes that begin before the interesting moment; **Mirror self-description** catches the tired trick of a character studying their reflection so the prose can catalog their looks, while leaving reflections that do real story work alone; **Empty greeting / small-talk openings** flags scenes that open on greeting rituals or logistical filler that carry no tension or information, while sparing pleasantries laced with subtext; **Kill your darlings** surfaces precious, self-indulgent passages — showpiece descriptions, digressions, over-explaining, favorite lines that stop the scene — as cut candidates, judged by story need rather than quality (complementing the dead-metaphor check, which targets stock rather than precious prose). The fifth, **Italicized internal thoughts**, is a deterministic, high-precision scan that flags multi-word `*…*` / `_…_` italic thought runs (the prose is already in the character's perspective, so italicizing a thought is a tell) while leaving single-word emphasis, bold, and `snake_case` alone, with a configurable word threshold. All findings anchor a verbatim quote + issue number; the LLM checks ship four new stage prompts (`pipeline-editorial-{opening-start,mirror-description,dialogue-pleasantries,kill-your-darlings}`) that migrate for existing installs (103–106), the deterministic check needs no model. (`server/lib/editorial/{italicThoughts,checkRegistry}.js`) (#1300)diff --git a/server/lib/promptRunner.js b/server/lib/promptRunner.jsindex cae3e70272..b01bee696e 100644--- a/server/lib/promptRunner.js+++ b/server/lib/promptRunner.js@@ -487,7 +487,17 @@ async function markProviderUnavailableFromError(failed, errorMessage, runnerAnal// provider is healthy and other prompts still work. Don't bench it (which// would route every subsequent task to the fallback for a full cooldown);// this single call still falls back via the caller's retry path.- if (category === ERROR_CATEGORIES.CONTENT_REFUSAL) return;+ //+ // A model-not-found is REQUEST-specific the same way: the request named a+ // model id the (reachable) endpoint doesn't have — a bad caller/config model,+ // not the provider being down. Benching the whole provider would take its+ // OTHER valid models offline for the full cooldown (e.g. one bad+ // `codex-configured-default` vision call benching Ollama so a correct+ // `qwen2.5vl` call then proactively swaps to a non-vision fallback). The+ // single failing call still falls back via the retry path; the provider stays+ // available for its working models. A genuine endpoint outage surfaces as+ // NETWORK_ERROR, not MODEL_NOT_FOUND, so it is still benched.+ if (category === ERROR_CATEGORIES.CONTENT_REFUSAL || category === ERROR_CATEGORIES.MODEL_NOT_FOUND) return;if (category === ERROR_CATEGORIES.USAGE_LIMIT) {await providerStatus.markUsageLimit(failed.id, {diff --git a/server/lib/promptRunner.test.js b/server/lib/promptRunner.test.jsindex fa46d63cf6..4a62cb2157 100644--- a/server/lib/promptRunner.test.js+++ b/server/lib/promptRunner.test.js@@ -61,6 +61,7 @@ const tuiRunner = await import('./tuiPromptRunner.js');const providers = await import('../services/providers.js');const autoFixer = await import('../services/autoFixer.js');const toolkitState = await import('./aiToolkitState.js');+const { ERROR_CATEGORIES } = await import('./aiToolkit/errorDetection.js');const { runPromptThroughProvider, resolveProviderAndModel, resolveEffectiveModel } = await import('./promptRunner.js');const apiProvider = (extra = {}) => ({@@ -725,6 +726,31 @@ describe('promptRunner — retry-with-fallback', () => {expect(autoFixer.noteFallbackFailed).not.toHaveBeenCalled();});+ it('does NOT bench the provider on a model-not-found (request-specific bad model id), but still falls back for this call', async () => {+ const status = mockToolkitWithFallback();++ // Primary API fails with a model-not-found — a bad model id in the request,+ // not a provider outage. The provider must stay available for its other+ // (valid) models; only this call falls back.+ runner.executeApiRun+ .mockImplementationOnce(async ({ onComplete }) => {+ onComplete({ success: false, error: "model 'bogus' not found", errorAnalysis: { category: ERROR_CATEGORIES.MODEL_NOT_FOUND } });+ })+ .mockImplementationOnce(async ({ onData, onComplete }) => {+ onData('fallback content');+ onComplete({ success: true });+ });++ const out = await runPromptThroughProvider({ provider: primaryApi, prompt: 'p', source: 'test' });++ expect(out.text).toBe('fallback content');+ expect(out.usedFallback).toBe(true);+ // The carve-out: the provider was NOT benched (mirrors CONTENT_REFUSAL).+ expect(status.markUnavailable).not.toHaveBeenCalled();+ // …but the failing call still recovered via the fallback.+ expect(status.getFallbackProvider).toHaveBeenCalledWith('primary-api', expect.any(Object));+ });+it('runs the configured fallbackModel on the fallback (never the primary model) when one is pinned', async () => {const status = mockToolkitWithFallback();// Provider-level fallback that pins a specific model to run on the fallback.