Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(chat): a missing pickle model is yellow, a pickle to download stays red (C60-S5)

purple5d7576e2d909
diff --git a/src/lib/__tests__/workflow-inspect.test.ts b/src/lib/__tests__/workflow-inspect.test.ts
index 29df5f4d..056937d9 100644
--- a/src/lib/__tests__/workflow-inspect.test.ts
+++ b/src/lib/__tests__/workflow-inspect.test.ts
@@ -162,8 +162,20 @@ describe('workflow_inspect traffic light', () => {
expect(r.light).toBe('green')
})
- it('red: a missing .ckpt is never downloaded', () => {
+ it('yellow: a missing .ckpt is never downloaded, the user picks a .safetensors model', () => {
const r = run(apiGraph({}, 'old.ckpt'))
+ expect(r.light).toBe('yellow')
+ expect(r.models[0].state).toBe('missing')
+ })
+
+ it('red: a .ckpt the workflow wants downloaded', () => {
+ const c = collectWorkflow(apiGraph({}, 'old.ckpt'))
+ if (!c.ok) throw new Error()
+ const r = inspectWorkflow({
+ bytes: 100, format: 'api', nodes: c.nodes, installed: BASE_INSTALLED, luPacks: [], registry: {}, catalog: () => null,
+ source: { kind: 'github' },
+ models: [{ name: 'old.ckpt', url: 'https://huggingface.co/a/b/resolve/main/old.ckpt', directory: 'checkpoints', hash: 'c'.repeat(64) }],
+ })
expect(r.light).toBe('red')
expect(r.models[0].state).toBe('refused')
})
diff --git a/src/lib/workflow-inspect.ts b/src/lib/workflow-inspect.ts
index bca99c56..f0e36e57 100644
--- a/src/lib/workflow-inspect.ts
+++ b/src/lib/workflow-inspect.ts
@@ -399,8 +399,16 @@ export function inspectWorkflow(input: InspectInput): InspectReport {
}
const d = declared.get(base)
if (PICKLE_EXT.test(base)) {
- models.push({ name, state: 'refused', why: 'a pickle file (.ckpt/.pt/.pth/.bin) can run code when loaded, LU does not fetch one' })
- flag(input.installed === null ? 'yellow' : 'red', `${name} is missing, and LU does not download pickle files (.ckpt, .pt, .pth, .bin).`)
+ // Missing and never fetched: nothing runs, so this is no risk of its own.
+ // The user picks a .safetensors model instead (an assignment replaces
+ // the loader's file). A pickle the file wants FETCHED stays red below.
+ if (d?.url) {
+ models.push({ name, state: 'refused', why: 'a pickle file (.ckpt/.pt/.pth/.bin) can run code when loaded, LU does not fetch one' })
+ flag('red', `${name} would be downloaded as a pickle file (.ckpt, .pt, .pth, .bin); LU never fetches those.`)
+ } else {
+ models.push({ name, state: 'missing', why: 'a pickle file LU never fetches; use a .safetensors model instead' })
+ flag('yellow', `${name} is missing. LU never fetches pickle files (.ckpt, .pt, .pth, .bin); use a .safetensors model for it, e.g. by assigning the workflow to one.`)
+ }
continue
}
if (d?.url) {