feat: recover interrupted installation preparation safely
This commit is contained in:
@@ -54,6 +54,17 @@ const modelCatalog: RuntimeModelCatalog = {
|
||||
hasSession: (id) => id === "zai/glm-5.2",
|
||||
};
|
||||
|
||||
test("a fresh installation can smoke-test its catalog default without saved user settings", async () => {
|
||||
const smokeProvider = vi.fn(async () => undefined);
|
||||
const service = createPiManagement(configFor(), {
|
||||
modelCatalog, execute: successfulExec([]), readSettings: () => ({}), smokeProvider,
|
||||
});
|
||||
expect(await service.test()).toMatchObject({ ready: true });
|
||||
expect(smokeProvider).toHaveBeenCalledWith(expect.objectContaining({
|
||||
provider: "zai", model: "glm-5.2", reasoning: "low",
|
||||
}));
|
||||
});
|
||||
|
||||
function successfulExec(calls: Array<{ command: string; args: string[]; timeout: number }>): PiExecFile {
|
||||
return async (command, args, options) => {
|
||||
calls.push({ command, args, timeout: options.timeout });
|
||||
|
||||
Reference in New Issue
Block a user