Skip to content

OpenRouter runner enables provider fallbacks for every selected model #9196

Open

Description

@soarkit

Project: superplanehq/superplane
Affected snapshot: 8118ede

Summary

The OpenRouter runner writes options.provider.allow_fallbacks: true for every model entry in the generated opencode.json. The component's retry semantics are described as retrying the same model; enabling provider fallbacks lets OpenRouter route a request to a backup provider, so a retry or a normal run can execute against a different provider than the one selected.

Expected behavior

The runner should keep allow_fallbacks disabled when the contract is to retry the selected model, as the parent revision did. If fallback routing is desired, it should be explicit configuration, not unconditional for every model.

Actual behavior

runPrompt('x-ai/grok-4.6') writes:

{
  "provider": {
    "openrouter": {
      "models": {
        "x-ai/grok-4.6": {
          "options": {
            "provider": {
              "allow_fallbacks": true,
              "sort": "throughput"
            }
          }
        }
      }
    }
  }
}

and invokes opencode ... -m openrouter/x-ai/grok-4.6. The parent revision emitted allow_fallbacks: false for the same input, and the target commit changed the value from false to true.

Root cause

pkg/components/runner/openrouter/run.js:490-498:

options: {
  provider: {
    allow_fallbacks: true,
    sort: "throughput",
  },
},

The value is hardcoded for every entry in modelEntries. The commit fix: Reset OpenCode retries after progress changed the line from false to true while its stated intent is to reset retries after progress, not to enable cross-provider fallback.

Impact

Every OpenRouter component run now permits backup-provider substitution. A request can be served by a different provider (with different pricing, data handling, or model revision) even though the user selected a specific model. Retry behavior no longer matches the "same model" contract and can mask provider-specific failures.

Suggested fix

Restore allow_fallbacks: false for the per-model options, or expose it as an explicit component input and default to false. Add a test asserting the generated opencode.json has allow_fallbacks: false unless the component explicitly opts in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions