fix(tiny): keep tiny-models download all green by skipping load-blocked models

resolveModels("all") expanded the full TINY_LOCAL_MODELS registry, which now
includes the qwen3-1.7b entry marked unsupportedReason. loadPipeline() throws
for such specs, so the download worker reported it as failed and the bulk
command exited with "One or more tiny title models failed to download" even
when every usable model downloaded. Filter unsupported specs out of the `all`
prefetch path; explicit single-model requests are unchanged. Addresses the
unaddressed Codex P2 on PR #3133.
This commit is contained in:
can1357
2026-06-20 21:48:44 +02:00
parent 28bbe4d14f
commit 6f17533041
2 changed files with 28 additions and 2 deletions
@@ -0,0 +1,24 @@
import { describe, expect, it } from "bun:test";
import { resolveModels } from "@oh-my-pi/pi-coding-agent/cli/tiny-models-cli";
import { TINY_LOCAL_MODELS } from "@oh-my-pi/pi-coding-agent/tiny/models";
describe("tiny-models download model resolution", () => {
it("excludes load-blocked models from `all` so the bulk prefetch stays green", () => {
const unsupported = TINY_LOCAL_MODELS.filter(spec => spec.unsupportedReason).map(spec => spec.key);
// Guard: keep this regression meaningful — at least one registry entry must be load-blocked.
expect(unsupported.length).toBeGreaterThan(0);
const all = resolveModels("all");
for (const key of unsupported) expect(all).not.toContain(key);
const usable = TINY_LOCAL_MODELS.filter(spec => !spec.unsupportedReason).map(spec => spec.key);
for (const key of usable) expect(all).toContain(key);
});
it("still resolves an explicitly requested unsupported model (only `all` is filtered)", () => {
const blocked = TINY_LOCAL_MODELS.find(spec => spec.unsupportedReason);
expect(blocked).toBeDefined();
if (!blocked) return;
expect(resolveModels(blocked.key)).toEqual([blocked.key]);
});
});