diff --git a/backend/src/app.ts b/backend/src/app.ts index 25e4ff51..fdc8ac35 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -99,7 +99,19 @@ export function buildApp(config: AppConfig, deps?: BuildAppDeps): FastifyInstanc }; const getSettings = async (principal: PrincipalContext): Promise => { 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 });