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
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user