Skip to content

runtime-fallback: fallback models lose variant and reasoningEffort settings #2621

@RaviTharuma

Description

@RaviTharuma

Problem

When runtime_fallback switches to a fallback model after an error, the fallback model runs without any variant or reasoningEffort settings from the agent config.

In autoRetryWithFallback() (line ~51399), the retry request sends only a bare model object:

model: {
  providerID: "chutes",
  modelID: "kimi-k2.5"
}
// No variant, no reasoningEffort

This means GPT and Chutes fallback models run without reasoning/thinking settings, producing lower quality responses than they would with proper configuration.

Why this matters

Real example: Sisyphus runs with variant: "max" and reasoningEffort: "xhigh" on Claude Opus 4.6. When it falls back to chutes/kimi-k2.5 or openai/gpt-5.4, those models run in their default (non-reasoning) mode instead of using the thinking capabilities the agent was configured for.

  • Anthropic/Gemini fallbacks partially work because OpenCode applies default thinking settings per model
  • OpenAI-compatible fallbacks (Chutes, OpenRouter, xAI) get NO reasoning settings at all

What should happen

autoRetryWithFallback should read the agent's configured variant and reasoningEffort from the OmO config and apply appropriate values to the fallback model. Since different providers support different settings, it should map intelligently:

  • @ai-sdk/anthropic fallback → apply variant (high/max) + reasoningEffort
  • @ai-sdk/google fallback → apply variant (high/max)
  • @ai-sdk/openai-compatible fallback → apply variant (low/medium/high) + reasoningEffort

Suggested fix

In autoRetryWithFallback, after building fallbackModelObj, also pass the variant:

await ctx.client.session.promptAsync({
  path: { id: sessionID },
  body: {
    ...retryAgent ? { agent: retryAgent } : {},
    model: {
      ...fallbackModelObj,
      variant: resolveVariantForProvider(fallbackModelObj.providerID, agentConfig.variant)
    },
    parts: retryParts
  },
  query: { directory: ctx.directory }
});

Note: the model-fallback hook already does this correctly — it passes fallback.variant in the output message. The runtime-fallback hook should do the same.

Environment

  • OmO version: latest (March 2026)
  • Provider setup: anthropic/ (@ai-sdk/anthropic), google/ (@ai-sdk/google), openai/ (@ai-sdk/openai-compatible) — all via CLIProxyAPI/Quotio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions