feat(settings): runtime log level + free provider enable/disable

- Add LOG_LEVEL env + runtime setLogLevel (dashboard Settings → Logging),
  applied immediately, persisted across restarts; WARN/ERROR quiet production
  INFO lines (▶ POST / 📊 DONE / [COMBO] / [CHAT])
- Allow toggling free/noAuth providers (gemini-cli, kilo, etc.) off via
  providerStrategies.enabled from Providers page and provider detail page
- auth.js: honor disabled override before noAuth/connection branches
- CompatibleModelsSection: parallel model testing
This commit is contained in:
2026-08-17 00:17:55 +07:00
parent a3182a7265
commit de9e00c66d
11 changed files with 507 additions and 61 deletions

View File

@@ -3,6 +3,7 @@ import { fileURLToPath } from "url";
import { dirname, join } from "path";
import { existsSync } from "fs";
import { cleanupProviderConnections, getSettings, updateSettings, getApiKeys } from "@/lib/localDb";
import { setLogLevel } from "@/sse/utils/logger";
import {
enableTunnel, enableTailscale,
isTunnelManuallyDisabled, isTunnelReconnecting, isTailscaleReconnecting,
@@ -83,6 +84,14 @@ async function runHeavyStartup() {
await cleanupProviderConnections();
const settings = await getSettings();
// Apply persisted log level (dashboard Settings → Logging) so production
// logs stay quiet (ERROR only) even after a restart.
try {
setLogLevel(settings.logLevel);
} catch (e) {
console.warn("[InitApp] setLogLevel failed:", e.message);
}
// Auto-resume tunnel (once per process)
if (settings.tunnelEnabled && !g.tunnelAutoResumed) {
g.tunnelAutoResumed = true;