From bddc710a90553d524b84f0b93362ce011e7755f0 Mon Sep 17 00:00:00 2001 From: southseact-3d Date: Wed, 11 Feb 2026 11:37:06 +0000 Subject: [PATCH] debug: add detailed logging for adminModels and provider detection - Log adminModels count and sample data - Log CHUTES_API_KEY status and prefix - Log detected providers from adminModels --- chat/server.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chat/server.js b/chat/server.js index 253fe18..1da1455 100644 --- a/chat/server.js +++ b/chat/server.js @@ -5126,9 +5126,24 @@ async function ensureOpencodeConfig(session) { // Ensure adminModels is loaded if (!adminModels || adminModels.length === 0) { + log('adminModels empty, loading from store', { sessionId: session.id }); await loadAdminModelStore(); } + // Debug logging + log('ensureOpencodeConfig debug', { + sessionId: session.id, + adminModelsCount: adminModels.length, + adminModelsSample: adminModels.slice(0, 2).map(m => ({ + id: m.id, + name: m.name, + providers: m.providers?.map(p => p.provider), + primaryProvider: m.primaryProvider + })), + chutesKeyExists: !!CHUTES_API_KEY, + chutesKeyPrefix: CHUTES_API_KEY ? CHUTES_API_KEY.substring(0, 8) + '...' : 'none' + }); + // Find which providers are used in adminModels const usedProviders = new Set(); for (const model of adminModels) { @@ -5142,6 +5157,11 @@ async function ensureOpencodeConfig(session) { } } + log('Detected providers from adminModels', { + usedProviders: Array.from(usedProviders), + count: usedProviders.size + }); + // Provider configurations with their base URLs const providerConfigs = { chutes: {