fix: default the settings workspace to the active registry workspace
This commit is contained in:
+13
-1
@@ -99,7 +99,19 @@ export function buildApp(config: AppConfig, deps?: BuildAppDeps): FastifyInstanc
|
||||
};
|
||||
const getSettings = async (principal: PrincipalContext): Promise<Settings> => {
|
||||
if (deps?.getSettings) return await deps.getSettings(principal);
|
||||
return effectiveSettings(config, loadSettings(config));
|
||||
const stored = loadSettings(config);
|
||||
const effective = effectiveSettings(config, stored);
|
||||
// In the registry system the legacy `harness/workspaces/*.yaml` default is obsolete: when no
|
||||
// installation workspace is pinned, default to the first active registry workspace.
|
||||
if (!stored.workspace) {
|
||||
try {
|
||||
const revisions = await workspaceRegistry.list();
|
||||
if (revisions.length > 0) effective.workspace = revisions[0].id;
|
||||
} catch {
|
||||
// Registry not bootstrapped yet; keep the legacy fallback.
|
||||
}
|
||||
}
|
||||
return effective;
|
||||
};
|
||||
const piManagement = deps?.piManagement ?? createPiManagement(config, { listModels });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user