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
address review (codex): include default-size bare-quant tags for un-pinned cards
[._.]/ Adam Eivy942f8cd19259
diff --git a/server/services/ollamaRegistryCatalog.js b/server/services/ollamaRegistryCatalog.jsindex 7740067097..db3b38a662 100644--- a/server/services/ollamaRegistryCatalog.js+++ b/server/services/ollamaRegistryCatalog.js@@ -190,8 +190,11 @@ export async function fetchOllamaRegistryVariants(id, { paramsHint = null, timeoif (!Array.isArray(tags) || tags.length === 0) return []// Constrain variants to the card's parameter size so one card never mixes a- // 1B and a 70B build in its picker.- const targetSize = sizeTokenOf(parsed.tag) || sizeTokenOf(paramsHint)+ // 1B and a 70B build in its picker. `explicitSize` (from the id's own tag, e.g.+ // `gpt-oss:20b`) pins a specific size; otherwise the size comes from the params+ // hint and the card represents the model's DEFAULT build.+ const explicitSize = sizeTokenOf(parsed.tag)+ const targetSize = explicitSize || sizeTokenOf(paramsHint)// Classify tags → quant-bearing ones at the target size, deduped by quant.const byQuant = new Map()@@ -199,11 +202,15 @@ export async function fetchOllamaRegistryVariants(id, { paramsHint = null, timeoconst quant = quantFromOllamaTag(tag)if (!quant) continueconst size = sizeTokenOf(tag)- if (targetSize) {- // With a known target size, require an explicit size match — a size-less- // bare-quant tag (`q4_K_M`) belongs to the model's default size, which may- // not be this card's build, so skip it.- if (size !== targetSize) continue+ if (size) {+ // A sized tag is kept only if it matches the card's target size.+ if (targetSize && size !== targetSize) continue+ } else if (explicitSize) {+ // A size-less bare-quant tag (`q4_K_M`/`q8_0`) is the model's DEFAULT-size+ // quant. Keep it when this card IS the default build (the id carries no size+ // tag), but skip it when the id pins a specific size — the default size may+ // differ from this card's build.+ continue}const existing = byQuant.get(quant)if (!existing || preferTag(tag, existing)) byQuant.set(quant, tag)diff --git a/server/services/ollamaRegistryCatalog.test.js b/server/services/ollamaRegistryCatalog.test.jsindex 12445dd664..bfaedf0a7d 100644--- a/server/services/ollamaRegistryCatalog.test.js+++ b/server/services/ollamaRegistryCatalog.test.js@@ -108,6 +108,28 @@ describe('fetchOllamaRegistryVariants', () => {expect(variants).toHaveLength(2)})+ it('includes size-less bare-quant tags for a default-build card (no explicit size in the id)', async () => {+ // `mistral` has no size tag in its id — the size comes only from the params hint,+ // so the card IS the default build and bare `q4_K_M`/`q8_0` tags are its quants.+ fetch.mockImplementation(registry(+ ['latest', 'q4_K_M', 'q8_0'],+ { q4_K_M: 4_000_000_000, q8_0: 7_000_000_000 }+ ))+ const variants = await fetchOllamaRegistryVariants('mistral', { paramsHint: '7B' })+ expect(variants.map((v) => v.installId).sort()).toEqual(['mistral:q4_K_M', 'mistral:q8_0'])+ })++ it('skips size-less bare-quant tags when the id pins an explicit size', async () => {+ // `gpt-oss:20b` pins 20b — bare `q4_K_M` is the model's DEFAULT-size quant, which+ // may be a different size, so it must not join the 20b card.+ fetch.mockImplementation(registry(+ ['q4_K_M', '20b-q4_K_M', '20b-q8_0'],+ { q4_K_M: 9_000_000_000, '20b-q4_K_M': 12_000_000_000, '20b-q8_0': 22_000_000_000 }+ ))+ const variants = await fetchOllamaRegistryVariants('gpt-oss:20b', { paramsHint: '20B' })+ expect(variants.map((v) => v.installId).sort()).toEqual(['gpt-oss:20b-q4_K_M', 'gpt-oss:20b-q8_0'])+ })+it('derives the target size from an explicit tag over the params hint', async () => {fetch.mockImplementation(registry(['20b-q4_K_M', '120b-q4_K_M'],