feat(runtime-fallback): add configurable session timeout controls
This commit is contained in:
parent
ff230df47c
commit
6a97f00a22
@ -9,6 +9,8 @@ export const RuntimeFallbackConfigSchema = z.object({
|
|||||||
max_fallback_attempts: z.number().min(1).max(20).optional(),
|
max_fallback_attempts: z.number().min(1).max(20).optional(),
|
||||||
/** Cooldown in seconds before retrying a failed model (default: 60) */
|
/** Cooldown in seconds before retrying a failed model (default: 60) */
|
||||||
cooldown_seconds: z.number().min(0).optional(),
|
cooldown_seconds: z.number().min(0).optional(),
|
||||||
|
/** Session-level timeout in seconds to advance fallback when provider hangs (default: 30) */
|
||||||
|
timeout_seconds: z.number().min(1).optional(),
|
||||||
/** Show toast notification when switching to fallback model (default: true) */
|
/** Show toast notification when switching to fallback model (default: true) */
|
||||||
notify_on_fallback: z.boolean().optional(),
|
notify_on_fallback: z.boolean().optional(),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -14,6 +14,7 @@ export const DEFAULT_CONFIG: Required<RuntimeFallbackConfig> = {
|
|||||||
retry_on_errors: [400, 429, 503, 529],
|
retry_on_errors: [400, 429, 503, 529],
|
||||||
max_fallback_attempts: 3,
|
max_fallback_attempts: 3,
|
||||||
cooldown_seconds: 60,
|
cooldown_seconds: 60,
|
||||||
|
timeout_seconds: 30,
|
||||||
notify_on_fallback: true,
|
notify_on_fallback: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,6 +58,8 @@ export interface RuntimeFallbackOptions {
|
|||||||
config?: RuntimeFallbackConfig
|
config?: RuntimeFallbackConfig
|
||||||
/** Optional plugin config override (primarily for testing) */
|
/** Optional plugin config override (primarily for testing) */
|
||||||
pluginConfig?: OhMyOpenCodeConfig
|
pluginConfig?: OhMyOpenCodeConfig
|
||||||
|
/** Optional session-level timeout override in milliseconds (primarily for testing) */
|
||||||
|
session_timeout_ms?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RuntimeFallbackHook {
|
export interface RuntimeFallbackHook {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user