360
return { ...defaults };
361
}
363
>
try {
364
>
const raw = fs.readFileSync(this._rootConfigResource.fsPath, 'utf8');
365
>
const parsed = JSON.parse(raw) as Record<string, unknown>;
366
>
return {
367
>
...agentHostCustomizationConfigSchema.validateOrDefault(parsed, defaults),
368
>
...sandboxConfigSchema.validateOrDefault(parsed, {}),
369
>
...copilotCliConfigSchema.validateOrDefault(parsed, {}),
370
>
};
371
>
} catch (err) {
372
>
const code = err && typeof err === 'object' && hasKey(err, { code: true }) ? String(err.code) : undefined;
373
>
if (code !== 'ENOENT') {
374
this._logService.warn(`[AgentConfigurationService] Failed to read host config from ${this._rootConfigResource.fsPath}: ${err instanceof Error ? err.message : String(err)}`);
375
}
377
>
}
378
}
379
}