fix: ship capability packs and starter skills, report the usable model (UF-066, UF-067)
The SDK reads pack manifests and starter skills next to its own module, which in the bundle is service.js, and no build step copied them there: installed builds showed no packs and no starter skills. build-sidecar now copies both folders next to service.js and Tauri bundles them (UF-066). GET /api/agent/status returned the configured model even when it had no key, so the status bar named Claude while chats ran on the local model. It now resolves the model the way the chat route does (UF-067).
This commit is contained in:
@@ -432,6 +432,30 @@ describe('LiteLLM Management API', () => {
|
||||
expect(body.model).toBe('ollama/llama3.2:latest');
|
||||
});
|
||||
|
||||
it('GET /api/agent/status reports the model chats will use, not an unusable default (UF-067)', async () => {
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const url = String(input);
|
||||
if (url.endsWith('/api/tags')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({ models: [{ name: 'llama3.2:latest', size: 2_000_000_000 }] }),
|
||||
} as Response;
|
||||
}
|
||||
return { ok: false, status: 503 } as Response;
|
||||
});
|
||||
const priorCurrentModel = server.agentState.currentModel;
|
||||
// As after a restart: the configured default has no key and nothing resolved it yet.
|
||||
server.agentState.currentModel = 'claude-sonnet-4-6';
|
||||
try {
|
||||
const res = await injectWithAuth(server, { method: 'GET', url: '/api/agent/status' });
|
||||
expect(res.statusCode).toBe(200);
|
||||
expect(JSON.parse(res.body).model).toBe('ollama/llama3.2:latest');
|
||||
expect(server.agentState.currentModel).toBe('claude-sonnet-4-6');
|
||||
} finally {
|
||||
server.agentState.currentModel = priorCurrentModel;
|
||||
}
|
||||
});
|
||||
|
||||
it('prefers a deterministic credentialed cloud fallback over an unrelated host Ollama model', async () => {
|
||||
const runtimePath = path.join(dataDir, 'litellm.runtime.json');
|
||||
const priorRuntime = fs.existsSync(runtimePath) ? fs.readFileSync(runtimePath, 'utf-8') : null;
|
||||
|
||||
Reference in New Issue
Block a user