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

parse the GGUF quant as a whole token so custom schemes don't yield a bogus Ollama tag

[._.]/ Adam Eivy135d2fc17261
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 82d073f5a7..f963f0f88d 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -32,6 +32,7 @@
## Fixed
+- **Hugging Face models with a custom quant scheme no longer produce an uninstallable Ollama id** — `quantFromFilename` matched a standard quant anywhere at the end of a GGUF filename, so a repo-specific scheme suffix bled into a bogus tag (`BTL-3-Compact-AVQ2.gguf` → `Q2`) and the resulting `hf.co/<repo>:Q2` pull failed with Ollama's `400 The specified tag is not a valid quantization scheme`. The quant now has to be its own trailing token (start-of-name or after a `-`/`_`/`.`); when nothing parses, the install id falls back to the bare repo, which Ollama resolves through its `latest` manifest.
- **CoS task cards no longer render a wall of prompt text** — a task's `context`, `blockedReason`/`blocker`, and challenge `reason` are now clamped to two lines with a Show more/Show less toggle, matching the description. Orchestrator tasks (e.g. the Creative Director production plan) store their entire prompt in `metadata.context`, so one pending task previously rendered as thousands of pixels of unclamped text the user had to scroll past to reach the rest of the queue; auto-blocked tasks had the same problem with LLM/stderr-derived block reasons, and a challenge reason is free text a worker agent writes to argue its case. The clamp+toggle (measured overflow, so the toggle only appears when the text actually spills) is extracted from `TaskItem` into a shared `client/src/components/ui/CollapsibleText.jsx`. Editing a task's context also moves from a single-line `<input>` to a bounded scrolling `<textarea>`, which was unusable for a multi-thousand-character prompt.
- `executeTuiRun`'s `finish()` now always settles its run promise even if a finalization step throws, so a one-shot TUI run can no longer hang forever (leaking the PTY and wedging `/runs`).
- `execGh` now times out (60s default, overridable) and kills a stalled `gh` CLI child, so a hung network/credential prompt can't wedge the scheduled PR-watcher / issue- and branch-reconcile / update-check jobs or orphan `gh` processes.
diff --git a/server/services/huggingFaceCatalog.js b/server/services/huggingFaceCatalog.js
index 4922abd59a..128aacaa49 100644
--- a/server/services/huggingFaceCatalog.js
+++ b/server/services/huggingFaceCatalog.js
@@ -206,8 +206,14 @@ function quantFromFilename(filename) {
// shard suffix — strip it so BF16/F16 splits resolve to their real quant
// instead of failing the match and being dropped from the variant list.
.replace(/-\d{5}-of-\d{5}$/i, '')
- const match = stem.match(/(?:UD-)?(?:IQ\d(?:_[A-Z0-9]+)*|Q\d(?:_[A-Z0-9]+)*|BF16|F16)$/i)
- return match?.[0] || null
+ // The quant must be its own trailing token — start-of-name or after a `-`/`_`/`.`
+ // separator. Without that boundary a repo's custom scheme suffix bleeds into a
+ // bogus standard quant (`BTL-3-Compact-AVQ2` → `Q2`), and the resulting
+ // `hf.co/<repo>:Q2` pull is rejected by Ollama with "not a valid quantization
+ // scheme". An unparseable quant is better as null: the install id then falls
+ // back to the bare repo, which Ollama resolves via its `latest` manifest.
+ const match = stem.match(/(?:^|[-_.])((?:UD-)?(?:IQ\d(?:_[A-Z0-9]+)*|Q\d(?:_[A-Z0-9]+)*|BF16|F16))$/i)
+ return match?.[1] || null
}
function pickGgufFile(model) {
diff --git a/server/services/huggingFaceCatalog.test.js b/server/services/huggingFaceCatalog.test.js
index 27c733304e..b2b0d74157 100644
--- a/server/services/huggingFaceCatalog.test.js
+++ b/server/services/huggingFaceCatalog.test.js
@@ -228,6 +228,21 @@ describe('huggingFaceCatalog', () => {
expect(result.variants.find((v) => v.quant === 'BF16')).toMatchObject({ recommended: true, fit: 'comfortable' })
})
+ it('does not mistake a custom quant scheme suffix for a standard quant tag', async () => {
+ // `…-AVQ2.gguf` is a repo-specific scheme, not `Q2`. Emitting `hf.co/<repo>:Q2`
+ // makes Ollama reject the pull ("not a valid quantization scheme"); the bare
+ // repo id resolves through Ollama's `latest` manifest instead.
+ const repo = 'exampleorg/Example-3-Compact'
+ fetch
+ .mockResolvedValueOnce(listing(repo, ['model/Example-3-Compact-AVQ2.gguf']))
+ .mockResolvedValueOnce(blobs(repo, { 'model/Example-3-Compact-AVQ2.gguf': 8_400_000_000 }))
+
+ const [result] = await searchHuggingFaceModels({ backend: 'ollama', query: 'example-3', systemMemoryBytes: 128 * 1024 ** 3 })
+
+ expect(result).toMatchObject({ id: `hf.co/${repo}`, quant: null, installable: true, sizeBytes: 8_400_000_000 })
+ expect(result.variants || []).toEqual([])
+ })
+
it('defaults to a small quant on a low-memory machine', async () => {
const repo = 'empero-ai/Qwythos-9B-Small-GGUF'
fetch