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 blank Hugging Face category tabs when the search box is empty
[._.]/ Adam Eivy321440c6f7e4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex fd9d92b180..c54bea02f8 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -85,3 +85,4 @@- **The name-dissimilarity check no longer flags a name against its own plural.** A role-noun cast ("THE POET" / "the poets", "a reader" / "readers", "a waiter" / "the waiters") tripped the check's edit-distance-1 rule — a single trailing "s" reads as a near-identical-spelling typo — and escalated each pair to a *high*-severity blocker, even though singular-vs-plural is a deliberate count distinction (an individual vs a crowd) a reader parses effortlessly. The check now recognizes singular/plural variants of the same noun (the three common English inflections: -s, -es, -ies) and treats the pair as inert, while two genuinely different words that merely both end in "s" still compare normally. (`server/lib/editorial/nameSimilarity.js`)- **A season synopsis is no longer truncated mid-sentence (which could hang Series Autopilot's arc-verify loop).** The season-synopsis cap was 4000 characters — half the arc-level summary cap (8000) — even though a season synopsis covers a whole season's worth of episodes. A full synopsis got hard-clipped mid-word, and because the arc-verify→resolve convergence loop re-flags a mid-sentence truncation while the resolver keeps regenerating an over-cap synopsis that gets re-clipped, the loop burned all its rounds and paused without ever converging. The season-synopsis cap is now 8000 (matching the arc summary), so a complete synopsis is stored intact. (`server/lib/storyArc.js`)- **Arc prose fields (logline, synopsis, ending hook) now clip on a sentence/word boundary instead of mid-word.** A hard character-cap `slice()` could clip a season logline or synopsis mid-word ("…starts tracing the brand and"), which the arc-verify pass flags as "truncated mid-sentence" — and because the resolver then regenerates an over-cap value that gets re-clipped identically, the verify→resolve loop could never converge and paused the autopilot. A new `trimToClause` helper backs an over-cap value off to the last sentence terminator within budget (or, for a run-on, the last whole-word boundary), so a capped field always reads as complete prose. Applied to the arc and season logline/summary/synopsis/ending-hook/protagonist-arc fields. (`server/lib/storyBible.js`, `server/lib/storyArc.js`)+- **Hugging Face model search now fills category tabs with no search term.** Clicking a category tag (Coding, Vision, Lightweight, Multilingual) on the Local LLM install page with an empty search box rendered a blank list. The default browse phrase for each category was a multi-word string ("coding coder agentic code gguf", "small 4b 3b 2b gguf"), but the Hub `search` param AND-matches every space-separated token against the model id — and no repo's id contains all of them, so the query returned zero results. Each category now seeds a short keyword + "gguf" phrase ("coder gguf", "vision gguf", etc.) that reliably returns the top-downloaded models for the category, and "Lightweight" uses "1b gguf" so it surfaces genuinely small models instead of `Mistral-Small-24B`. (`server/services/huggingFaceCatalog.js`)diff --git a/server/services/huggingFaceCatalog.js b/server/services/huggingFaceCatalog.jsindex 327fd63929..7603df54f3 100644--- a/server/services/huggingFaceCatalog.js+++ b/server/services/huggingFaceCatalog.js@@ -13,17 +13,28 @@ const HF_TIMEOUT_MS = 12_000const CATALOG_ENRICH_TIMEOUT_MS = 5_000const CATEGORY_IDS = new Set(LOCAL_LLM_CATEGORIES.map((c) => c.id))+// Default browse phrases used when the search box is empty (and as the seed when+// a category tag is clicked with no query). The Hub `search` param is AND-across+// the space-separated tokens against the model id, so a multi-word phrase like+// 'coding coder agentic code gguf' matches ZERO repos (no id contains all five) —+// the category tab then renders blank. Keep each phrase to a single category+// keyword + 'gguf' so the default browse reliably returns the top-downloaded+// matches for that category. The user's typed query overrides these entirely.const CATEGORY_SEARCH = {- chat: 'instruct chat gguf',- reasoning: 'reasoning thinking gguf',- coding: 'coding coder agentic code gguf',- vision: 'vision image text gguf',+ chat: 'instruct gguf',+ reasoning: 'reasoning gguf',+ coding: 'coder gguf',+ vision: 'vision gguf',// Audio is NOT a GGUF category — the search relaxes the GGUF filter for it// (see `searchHuggingFaceModels`) and these terms surface generation models.+ // Curated audio suggestions lead this list, so the live phrase can stay broad.audio: 'music audio text-to-music text-to-audio song generation',- embedding: 'embedding sentence-transformers gguf',- lightweight: 'small 4b 3b 2b gguf',- multilingual: 'multilingual qwen llama gguf'+ embedding: 'embedding gguf',+ // 'lightweight' means small param count — '1b' matches the genuinely tiny+ // models (gemma-1b, llama-3.2-1b, qwen-1.7b); a name token like 'small' would+ // instead surface Mistral-Small-24B, which is the opposite of lightweight.+ lightweight: '1b gguf',+ multilingual: 'multilingual gguf'}// Map a Hugging Face audio repo onto the PortOS music engine that can actuallydiff --git a/server/services/huggingFaceCatalog.test.js b/server/services/huggingFaceCatalog.test.jsindex 55569536f4..4238b7ea1a 100644--- a/server/services/huggingFaceCatalog.test.js+++ b/server/services/huggingFaceCatalog.test.js@@ -461,6 +461,31 @@ describe('huggingFaceCatalog', () => {})})+ describe('empty-query category browse', () => {+ // Clicking a category tag with no search term seeds the Hub query from+ // CATEGORY_SEARCH. The Hub `search` param is AND-across the space-separated+ // tokens against the model id, so a multi-word phrase ('coding coder agentic+ // code gguf') matches ZERO repos and the tab renders blank. Each browse+ // phrase must stay a short keyword + 'gguf' so the default browse returns the+ // top-downloaded matches. These tests lock that in for the GGUF categories.+ const sentSearch = () => {+ const call = fetch.mock.calls.find(([u]) => /[?&]search=/.test(String(u)) && /filter=gguf/.test(String(u)))+ return decodeURIComponent(String(call[0]).match(/[?&]search=([^&]*)/)[1])+ }++ it.each(['chat', 'reasoning', 'coding', 'vision', 'embedding', 'lightweight', 'multilingual'])(+ 'seeds a short (<=2 token) gguf browse phrase for category %s',+ async (category) => {+ fetch.mockResolvedValue(response([]))+ await searchHuggingFaceModels({ backend: 'ollama', category }) // no query+ const search = sentSearch()+ // A 5-word AND phrase is exactly the bug that blanked the coding tab.+ expect(search.trim().split(/\s+/).length).toBeLessThanOrEqual(2)+ expect(search).toMatch(/gguf/)+ }+ )+ })+describe('MLX models (Apple Silicon)', () => {// URL-aware mock: order matters (most-specific first). MLX adds a parallel// `filter=mlx` query + per-repo blobs fetch, so a sequential mock is fragile;@@ -558,7 +583,7 @@ describe('huggingFaceCatalog', () => {const mlxCall = fetch.mock.calls.find(([u]) => String(u).includes('filter=mlx'))expect(mlxCall).toBeTruthy()- // The category browse phrase ('…code gguf') must be rewritten for MLX, or+ // The category browse phrase ('coder gguf') must be rewritten for MLX, or// `filter=mlx&search=…gguf` filters every MLX-only repo out of the browse.expect(String(mlxCall[0])).not.toMatch(/search=[^&]*gguf/)expect(String(mlxCall[0])).toMatch(/search=[^&]*mlx/)