From 3ec9177082011f04f27cc45f4cb5a13fd3c34f20 Mon Sep 17 00:00:00 2001 From: southseact-3d Date: Wed, 11 Feb 2026 11:27:43 +0000 Subject: [PATCH] fix: load adminModels before sessions in bootstrap sequence - Move loadAdminModelStore() before loadState() in bootstrap() - This ensures adminModels is available when ensureOpencodeConfig is called - Fixes issue where Chutes provider was not being configured --- chat/server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chat/server.js b/chat/server.js index 6ad4ed3..253fe18 100644 --- a/chat/server.js +++ b/chat/server.js @@ -18185,7 +18185,7 @@ async function bootstrap() { process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); process.on('SIGINT', () => gracefulShutdown('SIGINT')); - await loadState(); + // Load admin models FIRST (before sessions) so ensureOpencodeConfig can use them await loadAdminModelStore(); await loadOpenRouterSettings(); await loadMistralSettings(); @@ -18198,6 +18198,7 @@ async function bootstrap() { await loadTopupSessions(); await loadPendingTopups(); await loadPaygSessions(); + await loadState(); // Load sessions LAST so adminModels is ready await loadPendingPayg(); await loadSubscriptionSessions(); await loadPendingSubscriptions();