Feat : Auto restart after crash

This commit is contained in:
decolua committed 2026-03-14 09:37:29 +07:00
1 parent 549223c8cf
commit adae2605bf
31 files changed
+340 -189

No files matched your search

+9 -2
View File
@@ -38,8 +38,15 @@ export async function handleComboChat({ body, models, handleSingleModel, log })
const modelStr = models[i];
log.info("COMBO", `Trying model ${i + 1}/${models.length}: ${modelStr}`);
const result = await handleSingleModel(body, modelStr);
let result;
try {
result = await handleSingleModel(body, modelStr);
} catch (e) {
lastError = `${modelStr}: ${e.message}`;
log.warn("COMBO", `Model threw exception, trying next`, { model: modelStr, error: e.message });
continue;
}
// Success or client error - return response
if (result.ok || result.status < 500) {
return result;