feat(config): disable runtime_fallback by default (opt-in)

This commit is contained in:
YeonGyu-Kim
2026-02-22 01:54:34 +09:00
parent 309869a79f
commit 976798d0e3
6 changed files with 6 additions and 6 deletions

View File

@@ -551,7 +551,7 @@ Auto-switches to backup models on API errors.
| Option | Default | Description |
|--------|---------|-------------|
| `enabled` | `true` | Enable runtime fallback |
| `enabled` | `false` | Enable runtime fallback |
| `retry_on_errors` | `[400,429,503,529]` | HTTP codes that trigger fallback. Also handles classified provider key errors. |
| `max_fallback_attempts` | `3` | Max fallback attempts per session (120) |
| `cooldown_seconds` | `60` | Seconds before retrying a failed model |

View File

@@ -45,7 +45,7 @@ export const OhMyOpenCodeConfigSchema = z.object({
skills: SkillsConfigSchema.optional(),
ralph_loop: RalphLoopConfigSchema.optional(),
/**
* Enable runtime fallback (default: true)
* Enable runtime fallback (default: false)
* Set to false to disable, or use object for advanced config:
* { "enabled": true, "retry_on_errors": [400, 429], "timeout_seconds": 30 }
*/

View File

@@ -1,7 +1,7 @@
import { z } from "zod"
export const RuntimeFallbackConfigSchema = z.object({
/** Enable runtime fallback (default: true) */
/** Enable runtime fallback (default: false) */
enabled: z.boolean().optional(),
/** HTTP status codes that trigger fallback (default: [400, 429, 503, 529]) */
retry_on_errors: z.array(z.number()).optional(),

View File

@@ -10,7 +10,7 @@ import type { RuntimeFallbackConfig } from "../../config"
* Default configuration values for runtime fallback
*/
export const DEFAULT_CONFIG: Required<RuntimeFallbackConfig> = {
enabled: true,
enabled: false,
retry_on_errors: [429, 500, 502, 503, 504],
max_fallback_attempts: 3,
cooldown_seconds: 60,

View File

@@ -64,7 +64,7 @@ export function createChatMessageHandler(args: {
hooks.runtimeFallback !== undefined &&
(typeof pluginConfig.runtime_fallback === "boolean"
? pluginConfig.runtime_fallback
: (pluginConfig.runtime_fallback?.enabled ?? true))
: (pluginConfig.runtime_fallback?.enabled ?? false))
return async (
input: ChatMessageInput,

View File

@@ -123,7 +123,7 @@ export function createEventHandler(args: {
hooks.runtimeFallback !== undefined &&
(typeof args.pluginConfig.runtime_fallback === "boolean"
? args.pluginConfig.runtime_fallback
: (args.pluginConfig.runtime_fallback?.enabled ?? true))
: (args.pluginConfig.runtime_fallback?.enabled ?? false))
// Avoid triggering multiple abort+continue cycles for the same failing assistant message.
const lastHandledModelErrorMessageID = new Map<string, string>()