- Added Hermes tool to CLI tools and updated related components.

This commit is contained in:
decolua
2026-04-23 16:39:31 +07:00
parent ab7dd63b22
commit 368f4c3e7f
15 changed files with 821 additions and 38 deletions
+15 -4
View File
@@ -41,13 +41,24 @@ export const RETRY_CONFIG = {
delayMs: 2000
};
// Default retry config by status code (number of retry attempts)
// Default retry config by status code: { attempts, delayMs }
// Backward compat: if value is a number, treated as attempts with RETRY_CONFIG.delayMs
export const DEFAULT_RETRY_CONFIG = {
429: 0, // Rate limit - no retry, use account fallback instead
503: 1, // Service unavailable - retry 1 time (transient)
502: 1 // Bad gateway - retry 1 time (transient)
429: { attempts: 0, delayMs: 0 },
502: { attempts: 1, delayMs: 3000 },
503: { attempts: 1, delayMs: 2000 }
};
// Normalize a retry entry to { attempts, delayMs }
export function resolveRetryEntry(entry) {
if (entry == null) return { attempts: 0, delayMs: RETRY_CONFIG.delayMs };
if (typeof entry === "number") return { attempts: entry, delayMs: RETRY_CONFIG.delayMs };
return {
attempts: entry.attempts || 0,
delayMs: entry.delayMs != null ? entry.delayMs : RETRY_CONFIG.delayMs
};
}
// Requests containing these texts will bypass provider
export const SKIP_PATTERNS = [
"Please write a 5-10 word title for the following conversation:"