fix(cli): auto-install runtime during setup (#116)

* fix(cli): auto-install runtime during setup

* test: align docs smoke with readme
This commit is contained in:
Andrey Avtomonov 2026-05-16 11:39:43 +02:00 committed by GitHub
parent 42b688e934
commit a72fca2b32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 131 additions and 23 deletions

View file

@ -1051,6 +1051,53 @@ describe('setup status', () => {
);
});
it('auto-installs the managed runtime by default during setup', async () => {
const io = makeIo();
const embeddings = vi.fn(async () => ({ status: 'ready' as const, projectDir: tempDir }));
const context = vi.fn(async () => ({ status: 'failed' as const, projectDir: tempDir }));
await expect(
runKtxSetup(
{
command: 'run',
projectDir: tempDir,
mode: 'new',
agents: false,
agentScope: 'project',
skipAgents: true,
inputMode: 'auto',
yes: false,
cliVersion: '0.2.0',
skipLlm: true,
skipEmbeddings: false,
databaseSchemas: [],
skipDatabases: true,
skipSources: true,
},
io.io,
{
embeddings,
context,
},
),
).resolves.toBe(1);
expect(embeddings).toHaveBeenCalledWith(
expect.objectContaining({
cliVersion: '0.2.0',
runtimeInstallPolicy: 'auto',
}),
io.io,
);
expect(context).toHaveBeenCalledWith(
expect.objectContaining({
cliVersion: '0.2.0',
runtimeInstallPolicy: 'auto',
}),
io.io,
);
});
it('lets Back from embedding setup return to the model step instead of exiting', async () => {
const testIo = makeIo();
const modelResults = [