💰 fix: Load app config in set-balance script to respect balance settings (#12669)

The `set-balance` script called `getBalanceConfig()` without the app
config, so it always reported balance as disabled regardless of the
librechat.yaml configuration. Mirror the working `add-balance` script
by loading the app config first and passing it into `getBalanceConfig`.

Fixes #12413

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Lionel Ringenbach 2026-05-30 07:36:14 -07:00 committed by GitHub
parent 444d923e29
commit 3487672a32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@ const mongoose = require('mongoose');
const { getBalanceConfig } = require('@librechat/api');
const { User, Balance } = require('@librechat/data-schemas').createModels(mongoose);
require('module-alias')({ base: path.resolve(__dirname, '..', 'api') });
const { getAppConfig } = require('~/server/services/Config');
const { askQuestion, silentExit } = require('./helpers');
const connect = require('./connect');
const { getAppConfig } = require('~/server/services/Config');