LibreChat/api/server/services/Config/loadCustomConfig.js
Danny Avila 696a1b6b56
🪪 feat: Name the Build and Config in Telemetry, Configure Stack Depth, Keep Scoped Frames (#17515)
* 🔎 fix: Keep Scoped Package Frames Out of the Log Email Redactor

The log redactor read node_modules/@scope/pkg/... as an address and replaced
whole stack frame locations with [REDACTED_EMAIL], in file, console and
OpenTelemetry output alike. An @ between path separators now names a scoped
package; addresses beside such frames are still masked.

* 🪪 feat: Name the Build and Loaded Config on OpenTelemetry Records

service.version now defaults to the image's BUILD_COMMIT ahead of the npm
package version. Each successful librechat.yaml load records a short digest
of the parsed file, which exported log records and request spans carry as
librechat.config.digest, and applies telemetry.stackTraceLimit to
Error.stackTraceLimit; unset keeps the process default.

* fix: Publish telemetry settings with the accepted base config

* fix: Initialize process settings before adopting cached config

* fix: Preserve runtime settings when cache writes are refused

* fix: Keep telemetry identity local and propagate Redis write errors

* fix: Partition merged config caches by the local base

* fix: Keep config cache failures recoverable

* test: Verify cache recovery contracts with typed fixtures

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-10-31 11:44:23 -04:00

17 lines
461 B
JavaScript

const path = require('path');
const {
loadYaml,
recordLoadedConfig,
redactConfigSecretMaps,
createCustomConfigLoader,
} = require('@librechat/api');
const projectRoot = path.resolve(__dirname, '..', '..', '..', '..');
const defaultConfigPath = path.resolve(projectRoot, 'librechat.yaml');
module.exports = createCustomConfigLoader({
loadLocal: loadYaml,
defaultConfigPath,
redactConfig: redactConfigSecretMaps,
onLoad: recordLoadedConfig,
});