Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,10 @@ export function deriveUserConfig(
enabledRuntimes: additive ? [...new Set([...(derived.init?.enabledRuntimes ?? []), ...runtimeIds])] : runtimeIds,
keepWarmRuntime: additive ? null : keepWarm,
additive,
...(recipesRoot ? { recipesRoot } : {}),
...(benchmarksRoot ? { benchmarksRoot } : {}),
...(backendCatalogPath ? { backendCatalogPath } : {})
// This run's sources replace the previous init's: recipeId is only valid in its own root.
recipesRoot: recipesRoot || undefined,
benchmarksRoot: benchmarksRoot || undefined,
backendCatalogPath: backendCatalogPath || undefined
};
return preserveEnvBackedSecrets(derived, sourceTemplate);
}
Expand Down
14 changes: 14 additions & 0 deletions test/hear-recipe.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,18 @@ assert.match(next.backends.hear.baseUrl, /^http:\/\/127\.0\.0\.1:\d+\/v1$/);
assert.deepEqual(next.aliases.hear.members, ['hear']);
assert.deepEqual(next.aliases.listen.members, ['hear']);

// An additive init from the default recipes must not inherit an earlier init's
// sources, or `lloom status` resolves the new recipeId in the old recipes root.
const staleSources = {
recipesRoot: '/stale/recipes',
benchmarksRoot: '/stale/benchmarks',
backendCatalogPath: '/stale/backends.json'
};
const restacked = await createInitPlan(
{ ...config, init: { recipeId: 'spark03-cuda-media', ...staleSources } },
{ recipeId: 'lloom-hear', additive: true, modelRoot: '/tmp/lloom-models' }
);
assert.equal(restacked.config.init.recipeId, 'lloom-hear');
for (const key of Object.keys(staleSources)) assert.equal(restacked.config.init[key], undefined, key);

console.log('hear-recipe tests passed');
Loading