[Bug]: foreground fallback replay drops the chain entry's variant

Author: ShreeMulayCreated Sep 26, 2026Updated Sep 30, 2026

Summary

When foreground fallback switches models, the replayed request drops the variant of the chain entry it switches to. The fallback model runs at its default effort instead of the configured one.

Version

oh-my-opencode-slim 2.2.25, OpenCode 1.18.32

Config

jsonc
"oracle": {
  "model": [
    { "id": "providerA/model-a", "variant": "high" },
    { "id": "providerB/model-b", "variant": "high" }
  ]
},
"fallback": { "enabled": true }

Steps to reproduce

  1. Make providerA/model-a fail with a failover error (for example, point it at an unreachable baseURL).
  2. Delegate a task to oracle.

Expected

The replayed request uses providerB/model-b with variant high.

Actual

The replay uses providerB/model-b with no variant. The stored assistant message has no variant.

Cause (from dist/index.js)

  • runtimeChains maps each entry to entry.id only, so ForegroundFallbackManager never sees variants.
  • execFallback builds body: { parts, model: ref, agent } with ref = parseModelReference(nextModel) and no variant. handleV2Retry has the same problem.

Suggested fix

Keep { id, variant } in the runtime chains and pass the selected entry's variant in the replay prompt (and in the v2 switchModel).

Workaround

Define a provider model alias that sets the effort in its default options, and use that alias as the fallback entry.

Source: alvinunreal/oh-my-opencode-slim