diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 0a3e29bd..f852fec0 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -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 (1–20) | | `cooldown_seconds` | `60` | Seconds before retrying a failed model | diff --git a/src/config/schema/oh-my-opencode-config.ts b/src/config/schema/oh-my-opencode-config.ts index ffd750c5..2517f597 100644 --- a/src/config/schema/oh-my-opencode-config.ts +++ b/src/config/schema/oh-my-opencode-config.ts @@ -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 } */ diff --git a/src/config/schema/runtime-fallback.ts b/src/config/schema/runtime-fallback.ts index 53219611..70ea1898 100644 --- a/src/config/schema/runtime-fallback.ts +++ b/src/config/schema/runtime-fallback.ts @@ -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(), diff --git a/src/hooks/runtime-fallback/constants.ts b/src/hooks/runtime-fallback/constants.ts index 62c736ea..60da6fb5 100644 --- a/src/hooks/runtime-fallback/constants.ts +++ b/src/hooks/runtime-fallback/constants.ts @@ -10,7 +10,7 @@ import type { RuntimeFallbackConfig } from "../../config" * Default configuration values for runtime fallback */ export const DEFAULT_CONFIG: Required = { - enabled: true, + enabled: false, retry_on_errors: [429, 500, 502, 503, 504], max_fallback_attempts: 3, cooldown_seconds: 60, diff --git a/src/plugin/chat-message.ts b/src/plugin/chat-message.ts index 8573abfe..f3c02297 100644 --- a/src/plugin/chat-message.ts +++ b/src/plugin/chat-message.ts @@ -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, diff --git a/src/plugin/event.ts b/src/plugin/event.ts index b0189124..e22089aa 100644 --- a/src/plugin/event.ts +++ b/src/plugin/event.ts @@ -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()