From 5d06d64a263cfb14edb417821eed566d4024692f Mon Sep 17 00:00:00 2001 From: shimmyshimmer Date: Thu, 23 Jul 2026 16:45:56 -0700 Subject: [PATCH] Studio: export autoLoadOnDeviceModel for tests Allows behavioral simulations to drive the real auto-load implementation directly instead of asserting on source text only. No runtime change. --- studio/frontend/src/features/chat/api/chat-adapter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/studio/frontend/src/features/chat/api/chat-adapter.ts b/studio/frontend/src/features/chat/api/chat-adapter.ts index 4eea97db4c..dfed8caa59 100644 --- a/studio/frontend/src/features/chat/api/chat-adapter.ts +++ b/studio/frontend/src/features/chat/api/chat-adapter.ts @@ -1569,8 +1569,10 @@ function isAutoLoadableGgufVariant(variant: GgufVariantDetail | null): boolean { * scan folders), then the smallest complete chat-capable on-device model * (GGUF first, then safetensors). Never downloads: with no valid on-device * candidate the caller shows the actionable "no model" error instead. + * + * Exported for tests. */ -async function autoLoadOnDeviceModel(): Promise<{ +export async function autoLoadOnDeviceModel(): Promise<{ loaded: boolean; blockedByTrustRemoteCode: boolean; /** True when an inventory failure was already surfaced to the user. */